One of my goals of today was to figure out how to deploy WordPress to Cloud Foundry. I figured this was a pretty simple goal, but alas there is a trick to it. The deploy process itself is at the bottom under TL;DR if you want to skip ahead; if not, then we’re going to take a walk through the arduous process of figuring that deploy out.
The Setup
For this particular deploy, I am using Pivotal Web Services. (This can be done with their trial account.)
I took a quick glance through the WordPress installation instructions and noticed a couple of things:
- WordPress is a PHP application, so I will need a PHP buildpack
- WordPress requires a MySQL database, so I will need to setup/bind a MySQL service to the application
Database configuration
To create the database service instance, I took a look at what the corresponding MySQL service is in PWS:
$ cf m | grep -i mysql
cleardb spark, boost, amp, shock Highly available MySQL for your Apps.
The free tier, spark, is large enough to handle WordPress. So to create the service instance:
$ cf create-service cleardb spark wordpress-db
Creating service wordpress-db in org quinn / space development as [email removed]...
OK
In order to obtain the service credentials, I went into the PWS console, selected the space, and clicked “Manage”:

This opens a new window/tab and passes your credentials to cleardb. Once the page loaded, I clicked on the database name:

And went to Endpoint Information:

All the parameters I need are all here, so I left the tab open to copy and paste later. In particular, the parameters of interest are:
| db name |
ad_a448706f10da344 |
| db user |
b37917c0af0c2a |
| db password |
6858192d |
| hostname |
us-cdbr-east-05.cleardb.net |
Setting up WordPress
I downloaded the tarball with wget, after both curl and curl -O failed with “unrecognized file” errors, and extracted the files from the tarball:
$ wget http://wordpress.org/latest.tar.gz
--2014-11-10 20:12:10-- http://wordpress.org/latest.tar.gz
Resolving wordpress.org... 66.155.40.250, 66.155.40.249
Connecting to wordpress.org|66.155.40.250|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://wordpress.org/latest.tar.gz [following]
--2014-11-10 20:12:10-- https://wordpress.org/latest.tar.gz
Connecting to wordpress.org|66.155.40.250|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6051082 (5.8M) [application/octet-stream]
Saving to: 'latest.tar.gz'
100%[===============================================================================================>] 6,051,082 1.28MB/s in 5.3s
2014-11-10 20:12:16 (1.09 MB/s) - 'latest.tar.gz' saved [6051082/6051082]
$ tar xfz latest.tar.gz
Note: I am on a laptop running Mac OS X, but I had already installed wget with Homebrew.
This created a wordpress directory with the app files. Before pushing, I needed to create wp-config.php from wp-config-sample.php and populate the database credentials (from above):

Before proceeding, I quickly verified that I did have a PHP buildpack available in PWS:
$ cf buildpacks | grep -i php
php_buildpack 7 true false php_buildpack-offline-v1.0.2.zip
Looking good! For the first push, I decided to push the application with the defaults (memory, disk, buildpack):
$ cf push wordpress-$(whoami)
Creating app wordpress-qanx in org quinn / space development as [email removed]...
OK
Using route wordpress-qanx.cfapps.io
Binding wordpress-qanx.cfapps.io to wordpress-qanx...
OK
Uploading wordpress-qanx...
Uploading app files from: /Users/qanx/Development/Books/AppsForBook/wordpress
Uploading 10.3M, 1226 files
OK
Starting app wordpress-qanx in org quinn / space development as [email removed]...
OK
-----> Downloaded app package (6.3M)
-------> Buildpack version 1.0.2
Use locally cached dependencies where possible
! WARNING: No composer.json found.
Using index.php to declare PHP applications is considered legacy
functionality and may lead to unexpected behavior.
See https://devcenter.heroku.com/categories/php
-----> Setting up runtime environment...
- PHP 5.5.12
- Apache 2.4.9
- Nginx 1.4.6
-----> Installing PHP extensions:
- opcache (automatic; bundled, using 'ext-opcache.ini')
-----> Installing dependencies...
Composer version ac497feabaa0d247c441178b7b4aaa4c61b07399 2014-06-10 14:13:12
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/app/.heroku/php/bin/composer self-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies
Nothing to install or update
Generating optimized autoload files
-----> Building runtime environment...
NOTICE: No Procfile, defaulting to 'web: vendor/bin/heroku-php-apache2'
-----> Uploading droplet (69M)
0 of 1 instances running, 1 starting
1 of 1 instances running
App started
Showing health and status for app wordpress-qanx in org quinn / space development as [email removed]...
OK
requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: wordpress-qanx.cfapps.io
state since cpu memory disk
#0 running 2014-11-10 09:38:43 PM 0.0% 90.1M of 1G 230.9M of 1G
No errors, the app has been uploaded, staged, and started! Everything looks great!
Except when I try to view my app in a web browser, all I see is:

…great.
Troubleshooting, a.k.a. What is going on with my app?!?1one

After the initial application push, I did some digging and found out that offline PHP buildpack that is included with PWS does not have all the necessary dependencies for WordPress. Instead, I should use cf-php-build-pack made by user dmikusa (employed by Pivotal). I should be good, right?
$ cf push -b https://github.com/dmikusa-pivotal/cf-php-build-pack.git wordpress-$(whoami)
Creating app wordpress-qanx in org quinn / space development as [email removed]...
OK
Using route wordpress-qanx.cfapps.io
Binding wordpress-qanx.cfapps.io to wordpress-qanx...
OK
Uploading wordpress-qanx...
Uploading app files from: /Users/qanx/Development/Books/AppsForBook/wordpress
Uploading 10.3M, 1229 files
OK
Starting app wordpress-qanx in org quinn / space development as [email removed]...
OK
-----> Downloaded app package (6.3M)
Cloning into '/tmp/buildpacks/cf-php-build-pack'...
Installing HTTPD
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-2.4.10.tar.gz] to [/tmp/httpd-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_unixd-2.4.10.tar.gz] to [/tmp/httpd-mod_unixd-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_setenvif-2.4.10.tar.gz] to [/tmp/httpd-mod_setenvif-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_proxy-2.4.10.tar.gz] to [/tmp/httpd-mod_proxy-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_dir-2.4.10.tar.gz] to [/tmp/httpd-mod_dir-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_reqtimeout-2.4.10.tar.gz] to [/tmp/httpd-mod_reqtimeout-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_log_config-2.4.10.tar.gz] to [/tmp/httpd-mod_log_config-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_authz_core-2.4.10.tar.gz] to [/tmp/httpd-mod_authz_core-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_mime-2.4.10.tar.gz] to [/tmp/httpd-mod_mime-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_proxy_fcgi-2.4.10.tar.gz] to [/tmp/httpd-mod_proxy_fcgi-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_remoteip-2.4.10.tar.gz] to [/tmp/httpd-mod_remoteip-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_env-2.4.10.tar.gz] to [/tmp/httpd-mod_env-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_mpm_event-2.4.10.tar.gz] to [/tmp/httpd-mod_mpm_event-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_rewrite-2.4.10.tar.gz] to [/tmp/httpd-mod_rewrite-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_authz_host-2.4.10.tar.gz] to [/tmp/httpd-mod_authz_host-2.4.10.tar.gz]
Installing PHP
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-5.4.34.tar.gz] to [/tmp/php-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-fpm-5.4.34.tar.gz] to [/tmp/php-fpm-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-mcrypt-5.4.34.tar.gz] to [/tmp/php-mcrypt-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-curl-5.4.34.tar.gz] to [/tmp/php-curl-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-zlib-5.4.34.tar.gz] to [/tmp/php-zlib-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-bz2-5.4.34.tar.gz] to [/tmp/php-bz2-5.4.34.tar.gz]
Finished: [2014-11-11 02:55:20.576107]
-----> Uploading droplet (17M)
1 of 1 instances running
App started
Showing health and status for app wordpress-qanx in org quinn / space development as [email removed]...
OK
requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: wordpress-qanx.cfapps.io
state since cpu memory disk
#0 running 2014-11-10 09:55:36 PM 0.0% 30.4M of 1G 48.6M of 1G
Wow. My app is much lighter than before. Now to view the app in my browser…

Lies.
So, what next?
Well, the README for the buildpack explicitly states that it supports the MySQL extension (amongst others):
supports a large set of PHP extensions, including amqp, apc, apcu, bz2, curl, codizy, dba, exif, fileinfo, ftp, gd, gettext, gmp, igbinary, imagick, imap, intl, ioncube, ldap, mailparse, mbstring, mcrypt, memcache, memcached, mongo, msgpack, mysql, mysqli, opcache, openssl, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, phpiredis, pspell, redis, suhosin, snmp, soap, sockets, sundown, twig, xcache, xdebug, xhprof, zip and zlib
Spoiler alert: there is a reason I highlighted both mysql and mysqli. Although on my first pass, I didn’t pay it too much any attention.
So I searched for “mysql php wordpress” and discovered that I needed to generate keys from the WordPress Secret Key Service and add them to wp-config.php, like so:
define('AUTH_KEY', 'y?<D;iZgGf++VMyj(O/aMVxzTFaefA<T|w2niki|SE] R0^1D9Z.UaChFlus|&PW');
define('SECURE_AUTH_KEY', 'yKN|-W-WslU9_s!Gl&< m @{^*Vl#/w./%7r@<u!SLU*Fh&>+R%A[GJWU8XfBz*-');
define('LOGGED_IN_KEY', ']k(K/5}.7,Q/ww5BeZ/F#zw9,<G_X!-}VG.LN-H&sD@|M_iTKAF7-nT 61l3%Sn.');
define('NONCE_KEY', 'nlM.+<|cZ-{-homB~H&oYW8vKq%O!eLg`^O^Wi#=/cq_*`EL5P-wn=>sSiCq*^,L');
define('AUTH_SALT', 'A_n`t0$KFd-&/cnO,V!BeGlirOYr%8;E&=|qeo9OTRYh&rT3:U_/<cgTI~tN1T(d');
define('SECURE_AUTH_SALT', ',z|d{,m8N)Wyv-e84Br=,|P1E-QmrxKN@rB|nf#p(5%ZlAlj%gkr!c|p]30V.6Z5');
define('LOGGED_IN_SALT', '9IG?@u9kM$+1:(lU*p`>3axe5f1S+TIAaGGuT%}K3V0QSvFA%?`=mo84I4HL;?8~');
define('NONCE_SALT', 'vvdtYrFDThGa0;8-lv}.k@*Ha-?c_6Cqg+[vcw+LJks1%;3;LD#{0,qirE%lZC#;');
Unfortunately, when I pushed again the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error message was still there. Admittedly I wasn’t surprised since I changed something that wasn’t MySQL related, but I had been hopeful it would at least help.
…aaand?
Since there was something clearly going on with the database, I figured it was time I tackled that directly. I asked around and found that I could add PHP extensions to the offline buildpack using a composer.json file. So I created the file and included the MySQL extension:
{
"require": {
"ext-mysql": "*"
}
}
To save myself some effort, I also made a manifest file:
---
applications:
- name: wordpress-qanx
memory: 128M
path: .
buildpack: https://github.com/dmikusa-pivotal/cf-php-build-pack.git
services:
- wordpress-db
Then I pushed the app:
$ cf push
Using manifest file /Users/qanx/Development/Books/AppsForBook/wordpress/manifest.yml
Creating app wordpress-qanx in org quinn / space development as [email removed]...
OK
Using route wordpress-qanx.cfapps.io
Binding wordpress-qanx.cfapps.io to wordpress-qanx...
OK
Uploading wordpress-qanx...
Uploading app files from: /Users/qanx/Development/Books/AppsForBook/wordpress
Uploading 10.3M, 1229 files
OK
Binding service wordpress-db to app wordpress-qanx in org quinn / space development as [email removed]...
OK
Starting app wordpress-qanx in org quinn / space development as [email removed]...
OK
-----> Downloaded app package (6.3M)
Cloning into '/tmp/buildpacks/cf-php-build-pack'...
Installing HTTPD
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-2.4.10.tar.gz] to [/tmp/httpd-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_unixd-2.4.10.tar.gz] to [/tmp/httpd-mod_unixd-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_setenvif-2.4.10.tar.gz] to [/tmp/httpd-mod_setenvif-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_proxy-2.4.10.tar.gz] to [/tmp/httpd-mod_proxy-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_dir-2.4.10.tar.gz] to [/tmp/httpd-mod_dir-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_reqtimeout-2.4.10.tar.gz] to [/tmp/httpd-mod_reqtimeout-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_log_config-2.4.10.tar.gz] to [/tmp/httpd-mod_log_config-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_authz_core-2.4.10.tar.gz] to [/tmp/httpd-mod_authz_core-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_mime-2.4.10.tar.gz] to [/tmp/httpd-mod_mime-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_proxy_fcgi-2.4.10.tar.gz] to [/tmp/httpd-mod_proxy_fcgi-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_remoteip-2.4.10.tar.gz] to [/tmp/httpd-mod_remoteip-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_env-2.4.10.tar.gz] to [/tmp/httpd-mod_env-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_mpm_event-2.4.10.tar.gz] to [/tmp/httpd-mod_mpm_event-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_rewrite-2.4.10.tar.gz] to [/tmp/httpd-mod_rewrite-2.4.10.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/httpd/2.4.10/httpd-mod_authz_host-2.4.10.tar.gz] to [/tmp/httpd-mod_authz_host-2.4.10.tar.gz]
Installing PHP
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-5.4.34.tar.gz] to [/tmp/php-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-bz2-5.4.34.tar.gz] to [/tmp/php-bz2-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-zlib-5.4.34.tar.gz] to [/tmp/php-zlib-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-openssl-5.4.34.tar.gz] to [/tmp/php-openssl-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-mcrypt-5.4.34.tar.gz] to [/tmp/php-mcrypt-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-curl-5.4.34.tar.gz] to [/tmp/php-curl-5.4.34.tar.gz]
Downloaded [http://php-bp-proxy.cfapps.io/files/lucid/php/5.4.34/php-cli-5.4.34.tar.gz] to [/tmp/php-cli-5.4.34.tar.gz]
PROTIP: Include a `composer.lock` file with your application! This will make sure the exact same version of dependencies are used when you deploy to CloudFoundry.
Loading composer repositories with package information
Installing dependencies
Nothing to install or update
Generating autoload files
Finished: [2014-11-11 17:40:04.156038]
-----> Uploading droplet (26M)
1 of 1 instances running
App started
Showing health and status for app wordpress-qanx in org quinn / space development as [email removed]...
OK
requested state: started
instances: 1/1
usage: 128M x 1 instances
urls: wordpress-qanx.cfapps.io
state since cpu memory disk
#0 running 2014-11-11 12:40:21 PM 0.0% 35M of 128M 70.8M of 1G
Now the error is back to Error establishing a database connection.
@*&#$*&^$*@&!!!!!!!
Who hurt you app? Who hurt you to make you treat us this way?
To save some time, I’m going to just list what came next:
- I tried removing the
path and buildpack lines fromm the manifest and pushing the app. (Still had composer.json.) Result? Error establishing a database connection.
- I tried deploying an earlier version of the app, version 3.9. Why this specific version? It’s worth mentioning that in May I had actually successfully deployed this app without a hitch, so I figured something either changed with WordPress between 3.9 and 4.0 or with Cloud Foundry between May and now (or both). With this deploy I did not use the
composer.json file since I didn’t use it in May. I put dmikusa’s buildpack back in the manifest though. Result? Back to Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
- So I tried adding the
composer.json file to the May WordPress deploy. No other changes (so I still used the external buildpack). Result? Error establishing a database connection.
- Out of frustration and willing to try anything, I saw on the buildpack’s README that it supported tagging. I changed the buildpack line to
https://github.com/dmikusa-pivotal/cf-php-build-pack.git#v2.0.0 and removed composer.json. No change.
- I added
composer.json back and removed the tag on the buildpack. And now it’s back to Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
At this point I’m reading to murder everything. I’ve periodically checked that I copied the credentials into wp-config.php correctly to spare myself some shame in case I found out I failed in that incredibly basic task. I did not. Thankfully.
Salvation
At this point, we’re all probably wondering some combination of “so can I deploy WordPress to Cloud Foundry or not?” and “maybe you should just try deploying another app?” I agree. Unfortunately since I know that this was a trivial task in May, I refuse to let this one go until I figure out why it no longer works. This has been a huge time investment. I no longer just want to know. I need to know like a panda needs bamboo.

I do some digging and discover that not only has dmikusa built the PHP buildpack I’ve been using, he’s also made adjustments to WordPress 4.0 to deploy to Cloud Foundry.

Well, that’s good to know. So let’s try deploying that app then.
Download the repo:
$ git clone https://github.com/dmikusa-pivotal/cf-ex-worpress.git
Included is a manifest.yml file that looks like so:
---
applications:
- name: mywordpress
memory: 128M
path: .
buildpack: https://github.com/dmikusa-pivotal/cf-php-build-pack.git
host: wordpress-on
services:
- mysql-db
env:
SSH_HOST: user@your-ssh-server
SSH_PATH: /full/or/relative/path/on/ssh/server
SSH_KEY_NAME: sshfs_rsa
SSH_OPTS: '["cache=yes", "kernel_cache", "compression=no", "large_read"]'
The README stated that the SSH options are for connecting to persistent storage. I don’t need that since I’m only deploying the app and won’t be keeping it for use. I edited the manifest.yml file to:
---
applications:
- name: cf-ex-wordpress
memory: 128M
path: .
buildpack: https://github.com/dmikusa-pivotal/cf-php-build-pack.git
host: wordpress-dmikusa
services:
- wordpress-db
The wp-config.php file is a little different for this app than the regular WordPress app. Here’s a snippet:
$services = json_decode($_ENV['VCAP_SERVICES'], true);
$service = $services['cleardb'][0]; // pick the first MySQL service
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', $service['credentials']['name']);
So instead of copy/pasting the credentials, the app pulls them directly from the environmental variable for the service. Awesome!
I push the app anaaaand:

Finally! Now all I have to do is figure out what difference is between this app and the two versions of WordPress that have been hurting my soul all day.
I run diff between wp-config.php for cf-ex-wordpress and the two versions WordPress to verify the only change was the use of environmental variables. It appeared to be. So, to eliminate once and for all the possibility of copy and paste error, I replaced the latter two wp-config.php files with the file from cf-ex-wordpress. I also replaced the manifests, but I removed the hostnames and changed the app names to keep them unique.
I deployed both 3.9 and 4.0. The initial deploys ran into the aforementioned errors. Rather than being frustated, I was relieved that I did not fail to copy and paste the credentials correctly. (I also tried deploying them both with and without the above composer.json file. No change.)
So then I decided I should go through the cf-ex-wordpress repo to see what made it special. It seemed like it should be the same as the “regular” 4.0, right?
Pretty much. Except, during my spelunking adventure I came across this lovely gem* of a file:
{
"ADMIN_EMAIL": "dan@mikusa.com",
"PHP_EXTENSIONS": ["mbstring", "mysqli", "mcrypt", "gd", "zip", "curl", "openssl", "sockets"]
}
* – Not an actual gem. No Ruby here!
mysqli. It uses. mysqli.
Murder me.
I edit composer.json for both the 3.9 and 4.0:
{
"require": {
"ext-mysqli": "*"
}
}
Then I try to deploy each. What do I see?
 |
 |
| version 3.9 |
version 4.0 |
Success. I see success.
TL;DR
WordPress can be deployed to Cloud Foundry by doing the following (note services are for PWS so there may be variation if other providers are used):
- Set up your MySQL service instance
- Download the latest version of WordPress
- Uncompress the file
- Generate the secret keys from the WordPress Secret Key Service
- Populate the keys into the appropriate section of the
wp-config.php file.
- Add the database credentials to the
wp-config.php file.
- Add a
composer.json file and include the mysqli extension.
- Deploy the application using dmikusa’s PHP buildpack.
- If you need to add persistent storage, I recommend using dmikusa’s manifest as a template.
You must be logged in to post a comment.