- State: development
- Production:
- Staging: http://pickee-wp-staging.herokuapp.com/ | Heroku
- Github: https://github.com/mypickee/pickee-wp
- CI/Deploys: CircleCI; merged PRs to master branch are automatically deployed to staging
- Install MySQL, PHP, nginx.
- Fork and clone this repo.
- Configure.
- Install Wordpress.
-
Install MySQL via Homebrew:
brew install mysql brew services start mysql # Start MySQL at login mysql -V mysqladmin -u root password # Set your root password
-
Create a user and database for our Wordpress site:
mysql -u root -p -e " CREATE DATABASE pickee_wp_development; CREATE USER pickee_wp_admin@localhost IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON pickee_wp_development.* TO pickee_wp_admin@localhost; FLUSH PRIVILEGES;"
-
Install PHP via Homebrew:
brew install php@7.2
-
Verify the right version. You might want to open a new terminal window and pick up the new
PATH
.php -v php-fpm -v
If they don't output PHP 7.2, make sure
/usr/local/sbin
is before/usr/sbin
in yourPATH
. -
Run
php --ini
to list config files. We will use our own config files for running php-fpm locally. -
Allow environment variables to reach FPM worker processes by making sure
clear_env
is set tono
inconfig/php-fpm/php-fpm.d/www.conf
.clear_env = no
-
Default log files
/usr/local/var/log/php-fpm.log
-
Install nginx via Homebrew:
brew install nginx
-
We will use our own config files for running nginx locally.
-
Default log files
/usr/local/var/log/nginx/access.log /usr/local/var/log/nginx/error.log
TODO
-
Copy over
.env.example
to.env
and make necessary changes:cp .env.example .env # Make necessary changes
-
Start PHP-FPM and nginx in non-daemon mode:
foreman start -f Procfile.dev
Visit http://localhost:7070/wp-admin and follow the steps to install Wordpress.
-
Occasiaonally nginx will raise 502 Bad Gateway error with message like:
2017/06/10 18:08:04 [error] 2462#0: *2 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /wp-admin/update-core.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:7070", referrer: "http://localhost:7070/wp-admin/"
Refreshing the page a few times would work again, but not sure what exactly the cause was.
-
Using
Ctrl-C
to exit foreman might not kill php-fpm processes gracefully and we need to find the process IDs and kill them manually.