Questions from a PHP newbie...

Questions from a PHP newbie...

Postby cjdelatte on Mon Nov 05, 2012 8:10 pm

Hi,
I'm not a PHP developer so I apologize in advance for the silly questions. I've been using ZendSvr for over a year now without any problems (although it took quite a bit of research to get it working). After we updated our v6r1 box with the latest PTFs, my PHP scripts no longer work. I've attempted to fix it myself by following the suggestions found on this site, but I'm still having trouble. Again, I'm not a PHP developer so I will provide you with any information I believe is relevant in the hopes that someone can assist me. I've tried a lot of different things and may have made the problem worse, but here is where I'm at:

This is what I get when I try to connect to our iSeries (I've abbreviated the errors). And it's not a typo... I get the date error listed twice:
Code: Select all
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings.... We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm in /usr/local/zendsvr/share/ToolkitAPI/ToolkitService.php on line 1382
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings.... We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm in /usr/local/zendsvr/share/ToolkitAPI/ToolkitService.php on line 1382
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/zendsvr/share/ToolkitAPI/ToolkitService.php:1382) in /www/zendsvr/htdocs/login.php on line 40


That 3rd error (about writing headers... on line 40) is what I believe might be worth tracing. My login.php page looks something like this (again, I didn't copy the whole thing). I've indicated line 40:
Code: Select all
session_start();
require_once 'cw.php';  // i copied this file right into the document root directory, to avoid any issues with paths
$user = $_POST['username'];
$pw = $_POST['password'];
$dbconn = i5_connect("localhost",$user,$pw);
if ($dbconn) {
// some code here
} else {
   header( "Location: index.php" );  // this is line 40, referenced in the error above
}


So line 40 would not even get executed if the i5_connect() function was successful. When I look in the log file, I see a whole bunch of this:
Code: Select all
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/zendsvr/lib/php/20090626/xsl . so' -    0509-022 Cannot load module /usr/local/zendsvr/lib/php/20090626/xsl . so.
   0509-021 Additional errors occurred but are not reported. in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/zendsvr/lib/php/20090626/zip . so' -    0509-022 Cannot load module /usr/local/zendsvr/lib/php/20090626/zip . so.
   0509-021 Additional errors occurred but are not reported. in Unknown on line 0
[:: Zend Extension Manager :: 05.11.2012 17:55:53 WARNING] [ ZendExtensionManager.cpp : 1104 ( zend_extension_manager_startup ) ] problem with load order file : zend_extension_manager.load_order_file not specified, will load by order of declarations in INI files


I have a lot of those "PHP Startup" errors about loading dynamic libraries. I don't know what this means, but I do see some LoadModule directives in my httpd.conf file, such as:
Code: Select all
LoadModule proxy_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
LoadModule proxy_http_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
LoadModule proxy_connect_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
LoadModule zend_enabler_module /QSYS.LIB/QHTTPSVR.LIB/QZFAST.SRVPGM


Some of the information I provided may not even be relevant. I just don't know enough to make that determination.

And just fyi... I downloaded the xmlservice.savf file, FTP'ed it to our box and ran the associated commands (all under QSECOFR). I received no errors when running these commands. I also stopped and restarted the server. I also ended and started the QHTTPSVR subsystem.

I apologize in advance for my ignorance but if anyone could offer a suggestion, I'd be most grateful. If I need to supply additional information, please let me know.
cjdelatte
 
Posts: 1
Joined: Mon Nov 05, 2012 7:18 pm

Re: Questions from a PHP newbie...

Postby timo_karvinen on Tue Nov 06, 2012 11:46 am

Here's how you can get rid of the "date warnings".
Find this section in your php.ini (default location /usr/local/zendsvr/etc/php.ini)
Code: Select all
[Date]
; Defines the default timezone used by the date functions
date.timezone="Europe/Helsinki"


And change whatever you have in "Europe/Helsinki" to match your location.
Also if there's comment char ";" in front of that line, remove it.
You can see available values from: php[dot]net/manual/en/timezones.php
(I'm not allowed to post links it seems.)

After the change is saved in php.ini you have to restart php/apache/zend server.

After this you should also get rid of the third warning about headers already send, because now you don't get those warnings send before the script.

About startup errors there seems to be some type or something somewhere:
Code: Select all
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/zendsvr/lib/php/20090626/xsl . so' -    0509-022 Cannot load module /usr/local/zendsvr/lib/php/20090626/xsl . so.
   0509-021 Additional errors occurred but are not reported. in Unknown on line 0

Because that's giving weird looking filename "xsl . so", try looking through your php.ini (see location above) and check it's without spaces (or are the spaces there because this stupid editor wont let you post otherwise).
Also check that file exists in IFS directory "/usr/local/zendsvr/lib/php/20090626/".
Again restart needed for php.ini changes to take effect.

Btw, none of these errors are directly related to Tolkit, just basic php.

-Timo
timo_karvinen
 
Posts: 74
Joined: Wed Aug 12, 2009 7:58 am
Location: Tampere, Finland


Return to New Toolkit

Who is online

Users browsing this forum: No registered users and 1 guest