These scripts will setup a Laravel Valet+ and WP CLI based local dev environment. Homebrew and Composer will also be installed if not already.
After you have looked at the source and are happy, install by running bash -c "$( curl -fsSL https://raw.githubusercontent.com/helpful/local_dev/master/install.sh )"
This will install the dev environment, and make the script clone.sh available.
- Composer error - conflicting symfony/console versions: resolve with
composer global require symfony/console "3.x" symfony/process "3.x", then re-run the install. -
- If this conflicts with other packages you might need to look at using consolidatino/cgr package to manage conflicts: weprovide/valet-plus#318 (comment)
- "Setting password for root user failed." warning: run
sudo mysqladmin -uroot password 'root' - Misc: do
brew services listto see if dnsmasq, mariadb, nginx and valet-php@7.2 are all running. If not usebrew services start xxxto start the missing ones. If neededbrew reinstall xxxis sometimes needed if they won't start and you can't see another error.
Running clone.sh will prompt for a few options, then copy the remote site into ~/Sites/xxx and open your browser to https://xxx.test to view it. It also accepts a single argument delete which will attempt to cleanly remove local sites when you're finished with them.
STUB:: In case of emergencies / problems, after debugging you can run bash -c "$( curl -fsSL https://raw.githubusercontent.com/helpful/local_dev/master/uninstall.sh )", restart your machine, then follow with a re-install using the command above. This will preserve ~/Sites and databases, but always backup first.
Note - this isn't seamless, Nginx config files are delete which means you will need to run valet secure in each relevant Sites/* directory to turn on SSL again, and also the 'load image from live' code is lost. Ideally use clone.sh delete to remove a site and start again, or clone.sh and option 5 to re-clone/set it up from scratch.
If you want to update clone.sh, you can run curl -o /usr/local/bin/clone.sh -fsSL https://raw.githubusercontent.com/helpful/local_dev/master/clone.sh ; chmod +x /usr/local/bin/clone.sh
If you want to do a more thorough uninstall, including removing site files and databases, you can download the uninstall.sh script, and run it passing the argument nuke.
curl -o uninstall.sh https://raw.githubusercontent.com/helpful/local_dev/master/uninstall.shchmod +x uninstall.sh./uninstall.sh nuke- restart your machine