Monthly Archives: October 2014

Can you run PHP on IBM Bluemix (Cloud Foundry)?

Yes! I was confused about running PHP on IBM’s Bluemix Cloud services, but thanks to Daniel Krook he pointed me in the right direction. He recommends that you use Mikusa’s build pack which has a simple 30 second tutorial on how to deploy

https://github.com/dmikusa-pivotal/cf-php-build-pack

The big confusion for me is that they have a thing called BlueMix.net and Cloud Foundry and its hard to decipher what is IBM’s cloud service. Unlike Amazon, which simply uses Amazon Webservices. “Bluemix is built on Cloud Foundry” – Bradley Holt, so BlueMix is like your app built on top of PHP runtime. They also offer runtimes for java, node.js, Ruby, BUT no PHP in their documentation https://www.ng.bluemix.net/docs/#.

More info on BlueMix and PHP from Daniel Krook: https://bitly.com/cf-for-php

Another Example: https://github.com/IBM-Bluemix/todo-apps/tree/master/php

QCCSID 65535 Workaround – when using IBM i PHP toolkit

Recently I was going to start using the i5_toolkit again but ran into an issue with my system value for QCCSID set to 65535. Luckily Alan Seiden helped me out and let me know that you can set it in Apache or the user profile. So in your httpd.conf file you just need to set these values:

DefaultFsCCSID 37
DefaultNetCCSID 37

Now if your running PHP via the command line you’ll have to run either changer user profile or change job ccsid:

CHGUSRPRF USRPRF(MJORDAN) CCSID(37)
CHGJOB CCSID(37)

before you call php.

Special Registers on DB2 for IBM i – Retrieve via SQL

Ever wondered what special registers there are and what they are set to on your DB2 for IBM i? Well run this SQL script and find out:

SELECT CURRENT CLIENT_ACCTNG AS ACCOUNTINGSTRINGSPCREG,
    CURRENT CLIENT_APPLNAME AS APPLICATIONNAMESPCREG,
    CURRENT CLIENT_PROGRAMID AS CLIENTPROGRAMIDSPCREG,
    CURRENT CLIENT_USERID AS CLIENTUSERIDSPCREG,
    CURRENT CLIENT_WRKSTNNAME AS WORKSTATIONNAMESPCREG,
    CURRENT_DATE AS CURRENTDATESPCREG,
    CURRENT DEBUG MODE AS DEBUGMODESPCREG,
    CURRENT DECFLOAT ROUNDING MODE AS DECROUNDINGMODESPCREG,
    CURRENT DEGREE AS DEGREEOFIOOFSMPSPCREG,
    CURRENT_PATH AS PATHFORUNQUALIFIEDNAMESSPCREG,
    CURRENT_SCHEMA AS CURRENTSCHEMASPCREG,
    CURRENT_SERVER AS CURRENTSERVERSPCREG,
    CURRENT_TIME AS CURRENTTIMESPCREG,
    CURRENT_TIMESTAMP AS CURRENTTIMESTAMPSPCREG,
    CURRENT_TIMEZONE AS CURRENTTIMEZONESPCREG,
    SESSION_USER  AS SESSIONUSRSPCREG,
    USER AS USERVALUESPCREG,
    SYSTEM_USER AS SYSTEMUSERSPCREG
FROM SYSIBM.SYSDUMMY1;

-- CURRENT USER was added in IBM i 7.2

You can use these values at anytime in your SQL script. Perhaps you want to save the current time and the user that made the change to the record.