- 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 list mysql -V mysqladmin -u root password # Set your root password
-
Create a user and database for our Wordpress site:
mysql> CREATE DATABASE pickee_wp_development; Query OK, 1 row affected (0.03 sec) mysql> CREATE USER pickee_wp_admin@localhost IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.01 sec) mysql> GRANT ALL PRIVILEGES ON pickee_wp_development.* TO pickee_wp_admin@localhost; Query OK, 0 rows affected (0.01 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec) mysql> exit Bye
-
Install PHP via Homebrew:
brew install php70 --with-debug php -v php-fpm -v
If
php-fpm
doesn't output php 7, make sure/usr/local/sbin
is before/usr/sbin
. -
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
-
Install nginx via Homebrew:
brew install nginx
-
We will use our own config files for running nginx locally.
-
Log files
/usr/local/var/log/php-fpm.log /usr/local/var/log/nginx/access.log /usr/local/var/log/nginx/error.log
-
Config files
/usr/local/etc/php/7.0/php.ini
TODO
-
Copy over
.env.example
to.env
and make necessary changes:cp .env.example .env # Make necessary changes
-
Start 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.