We have written a web application in PHP using Zend installed on an IBM i server. SQL connections to the server are done using the db2 utilities (db2_pconnect, db2_prepare, db2_bind_param and db2_execute functions). It also makes calls to RPG procedures using the new XTOOLKIT toolkit.
At the start of last week we went live with a pilot client. Users have reported that every now and then (maybe 3 or 4 times a day) the application hangs and grinds to a halt. Ending and restarting the Zend server resolves it until the next time but I need to find the cause to stop it happening in the first place.
The only relevant message I can see in the Zend server log is:
- Code: Select all
PHP Warning: db2_prepare() [<a href='function.db2-prepare'>function.db2-prepare</a>]: Statement Prepare Failed in xxxxxxxxxx on line 96
(where ‘xxxxxxxxxx on line 96’ is where my PHP calls db2-prepare). But I think this is symptom rather than a cause.
Looking elsewhere, in the QTMHHTTP/ZENDSVR jobs I see an occurrence of message:
- Code: Select all
Connection to relational database XXXXXXXXXX does not exist.
and several occurrences of message:
- Code: Select all
Error occurred in SQL Call Level Interface
The measures we have taken so far are:
1. Following the advice at http://www-304.ibm.com/support/docview.wss?uid=swg21476411 since we noticed that lots of the QSQSRVR jobs (where I believe the SQL statement run) seemed to be stuck at status JOBLOG PENDING. We wondered if Zend was trying to reuse some of these dying jobs.
2. Increasing time-out values in php.ini (max_execution_time), httpd.conf and fastcgi.conf, in case response time-outs are causing a connection to be lost.
3. Performance improvements to our application, for the same reason.
Since then the application generally seems to be running faster, and we no longer get the JOBLOG PENDING jobs, and but we still get the hanging.
We are using PHP version 5.3.8-ZS5.5.0, Zend Framework (CE) version 1.11.10, and version V5R4M0 of the IBM i O/S.
Any assistance or pointers would be gratefully received. We are quite new to PHP and Zend so may have overlooked something obvious.

