My local WordPress development environment.
Run this command in the terminal:
composer --keep-vcs --repository-url=git@github.com:wpscholar/local.git create-project wpscholar/local
The installation process will check your environment for the required PHP version and PHP extensions. If this presents a problem and you want to force install anyway, just add the --ignore-platform-reqs flag to the command.
- Install Lando
- Run
git clone git@github.com:wpscholar/local.gitto pull down the code. - Run
cd localto change into the project root directory. - Run
lando startto initialize and start the containers. - Copy the
.env.examplefile as.env. - Run
composer installto install required dependencies. - Run
lando composer run set-saltsto generate salts. - Import a copy of the production database using the
lando db-import <file>command where<file>is the name of the SQL file you've placed in the current directory. - Visit local.lndo.site
- Trust the CA (Optional)
- Install Homebrew
- Install Laravel Valet
- Install MySQL using Homebrew:
brew install mysql - Start MySQL using Homebrew:
brew services start mysql - Set password to be
rootfor the root user:$(brew --prefix mysql)/bin/mysqladmin -u root password root - Run
composer --keep-vcs --repository-url=git@github.com:wpscholar/local.git create-project wpscholar/local - Run
valet link local(unless you've already runvalet parkand are in your Valet root directory) - Run
valet secure local - Run
cd local - Copy the
.env.examplefile as.env. - Run
composer run wp db create- You may need to rename the database in your.envfile first if you don't want your database to be namedlocal. - Visit
https://local.test(unless you set a different top level domain) in the browser to finish the WordPress installation.
- Install Local
- Create a new WordPress site using the UI
- Navigate to the site's
appdirectory in the terminal. - Run
rm -rf publicto delete thepublicdirectory. - Run
composer --keep-vcs --repository-url=git@github.com:wpscholar/local.git create-project wpscholar/local public - Click the link in Local to visit the site in the browser.
Open up the .env file to edit database credentials or other WordPress constants.