Local by Flywheel (formerly known as Local) is a popular tool for setting up a local WordPress development environment on your computer. We will be using it to set up your computer to run PHP:

1. **Download and Install Local by Flywheel:**

– Visit the Local by Flywheel website (https://localwp.com/) and download the version compatible with your operating system (Windows or macOS).
– Run the installer and follow the on-screen instructions to install Local by Flywheel.

2. **Launch Local by Flywheel:**

– After installation, launch the Local by Flywheel application. You’ll need to create a free account or log in if you already have one.

3. **Create a New WordPress Site:**

– Once logged in, click the “+ add local site” button on the bottom left.
– Click “Continue”
– Enter a name for your site, choose a local domain name (e.g., php-workspace), and select the environment (select “Custom”).
– Choose the web server (Apache or Nginx), PHP version, and database version.
– Click “Continue”
– Enter a WordPress user name (admin), WordPress password (admin), and an email address.
– Click the “Add Site” button to create your local WordPress site.
– Click “Yes” when it asks you to allow this app to make changes to your device?

4. **Start the Local Environment:**

– Click on your newly created site in the Local by Flywheel dashboard.
– Click the “Start Site” button to launch the local development environment.
– Local by Flywheel will automatically set up the web server, PHP, and MySQL for your WordPress site.

5. **Go to Site Folder:**

– Once the environment is running, click on the “Go to site folder” button to access your new phpworkspace folder. This opens a folder called php-workspace and has 3 folders in it: app, conf, and logs.
– Open the app folder
There you will see two folders: public and sql
– Open the public folder
– There you will see the WordPress installation files
– Select all the files and delete them
– we are not working within the WordPress environment at this point
– open your favorite program editor (eg notepad++)
– create an index.php file and save it in your Local Sites\php-workspace\app\public folder

6. **Develop in your PHP Workspace:**

– You can now develop and customize your PHP site locally, just like you would on a live server.
– as you make changes in the editor you can save the file
– then refresh the view in your web browser

7. **Stop and Restart Your Local Environment:**

– In the Local by Flywheel dashboard, you can stop or restart your local site’s environment as needed.

Local by Flywheel provides an easy-to-use interface for managing local PHP and MySQL development environments. It also allows you to create and manage multiple sites for different projects.

Leave a Reply

Your email address will not be published. Required fields are marked *