Below is a simple way of installing RPMs needed to get PHP 7.0.13 & Nginx 1.11.8-1 running on an IBM i Power System. By the end of it you’ll be able to send http requests to http://yoursite.com:61183/ that are answered by nginx and passed to php-fpm to process.
Recently a friend ran into this issue. One way to correct this issue is to set the i5_libl option on the db2 connection options (http://php.net/manual/en/function.db2-connect.php). Another way to do this is by changing the job description associated with the IBM i user profile by using the command CHGJOBD in a 5250 session. You would set the INLLIBL to LIBL (library list) you want to use. Then assign the jobd
(job description) to user profile your connecting with DB2_connect or Zend_DB and the ibmdb2 adapter.
CHGJOBD JOBD(MYJOBD) INLLIBL(&MYLIB &ANOTHERLIB)
Then associate this jobd with the user profile
To Debug the issue there are a few DB2 for i services you can call from PHP via SQL and they are:
Say you have a phone number in various formats but you just want the numeric characters and all the non-numeric characters removed. Well use the SQL function REGEXP_REPLACE and look for characters with the regular expression [^\d] and replace it with empty character ”. [^\d] is a negated set which means match any characters not in between [^ and ]. \d is a short hand way of saying all digit characters 0-9.
SELECT PHONE_NUMBER, REGEXP_REPLACE(PHONE_NUMBER,'[^\d]’,”)
IBM documentation on REGEXP_REPLACE
Online regex tester tool