This is generic CloudFoundry free, IBM free way of installing WordPress. Most of the guides on web are far inferior and does not involve checking of MySQL connection. Here is how to install WordPress on IBM BlueMix in easy way via git. You need idea of using SSH, Git, MySQL via CLI to follow this guide.
Install WordPress on IBM BlueMix : Easy Way Via Git
Login to BlueMix account. Create a Bluemix PHP application from the catalog using CloudFoundry PHP Buildpack. Fill the application name field, just deploy it, test the URL of the sample app. Then create MySQL database (Compose for MySQL) in Bluemix. You’ll see a dialog that will asking you to restage the application, click Restage and continue.
Click on the View credentials button of MySQL service box, where you’ll see a dialog with the service configuration and credentials in JSON format. Copy-paste and save it somewhere. It will have lines like :
1 2 | "uri_cli": "mysql -u admin -p --host sl-aus-syd-1-portal.1.dblayer.com --port 18006 --ssl-mode=REQUIRED", "uri_direct_1": "mysql://admin:ABCDEFGHIJKKLMNOP@sl-aus-syd-1-portal.2.dblayer.com:18006/compose", |
If you have a server (or localhost) with root access where MySQL client running, SSH to it and test with the above command :
---
1 | mysql -u admin -p --host sl-aus-syd-1-portal.1.dblayer.com --port 18006 |
It will ask for password. In the above example, ABCDEFGHIJKKLMNOP
is password. If you run command show database;
on MySQL, it will show the names of MySQL databases :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 706 Server version: 5.7.19-log MySQL Community Server (GPL) Copyright (c) 2009-2017 Percona LLC and/or its affiliates Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | compose | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.31 sec) |
That means MySQL is fine and we know the host name, username, password of MySQL.
Go to the PHP Application created, under the Overview section you’ll find and area called Continuous delivery, push the Enable button of this section. Scroll down the initial form and look for the Git Repos and Issue Tracking options, then change the value of Repository type to New and press the Create button. Now go to Git Profile URL of Bluemix, which at present is :
1 | https://git.ng.bluemix.net/profile |
Add SSH keys and other things (like Github) which we normally get on Mac & GNU/Linux by running :
1 | cat ~/.ssh/id_rsa.pub |
You’ll see that on Git of that PHP application, it will be written how to clone, add changes etc. From local computer you can run like this, just to make you understand :
1 2 3 4 5 6 7 8 9 | git config --global user.name "Abhishek Ghosh" git config --global user.email "webmaster@thecustomizewindows.com" git clone git@git.ng.bluemix.net:webmasterXY/WordPressAbhishek.git Cloning into 'WordPressAbhishek'... The authenticity of host 'git.ng.bluemix.net (169.53.247.244)' can't be established. ECDSA key fingerprint is SHA256:BQx1OpGLx8cTkoL6RmftFgTGFHBz2tKPICJm5My4fa8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'git.ng.bluemix.net,169.53.247.244' (ECDSA) to the list of known hosts. git@git.ng.bluemix.net's password: |
Now change directory to that repo’s clone on localhost. Then wget
WordPress :
1 2 3 4 5 6 7 | wget https://wordpress.org/latest.zip unzip latest.zip rm latest.zip cd wordpress mv * .. cd .. rm -r wordpress |
All files are at root now. Rename wp-config-sample.php
and edit it :
1 2 | mv wp-config-sample.php wp-config.php nano wp-config.php |
MySQL settings for wp-config.php
will be like this, compose
and admin
are probably constant for all regions :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ... // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'compose'); /** MySQL database username */ define('DB_USER', 'admin'); /** MySQL database password */ define('DB_PASSWORD', 'ABCDEFGHIJKKLMNO'); /** MySQL hostname */ define('DB_HOST', 'sl-aus-syd-1-portal.2.dblayer.com:18006'); ... |
Save the file. Only IBM Bluemix specific work you need to do is :
1 2 3 | mkdir .bp-config cd .bp-config nano options.json |
Add this to options.json
:
1 2 3 | { "PHP_EXTENSIONS": ["bz2", "zlib", "curl", "mcrypt", "mysql"] } |
Save the file. Push it :
1 2 3 | mkdir .bp-config cd .bp-config nano options.json |
Add this to options.json
:
1 2 3 | git add . git commit -m "first push" git push -u origin master |
After few minutes, go to the web URL of PHP application and you’ll get the usual WordPress installation wizard. WordPress will nicely run like my test :
Tagged With abcdefghijkklmno