After deploying a newer version of the PHP Toolkit for IBM i library, and making the newer version the default, scripts continue to run version 1.5.0 of the Toolkit.
Zend Server for IBM i version 6 - 8.5.x, that has been upgraded from version 6.1.0 or earlier, running on any supported version of IBM i.
The PHP Toolkit was installed in older versions of Zend Server in this directory:
In newer versions, this directory was made a symlink to the default library directory for the PHP Toolkit:
Zend Deployment will place whichever version is specified as the default into this directory. This allows the default version to be changed in the Zend Server User Interface. If the old directory is not symlinked to the new directory, then changes to the default version may not be honored in your code, if the include_path still has the old directory.
Here is how to tell if you have this issue:
Step 1) From the command entry line in a 5250 session, logged in as QSECOFR or a user with *SECOFR special authority:
This brings up the PASE shell. First use this command to verify that the new default library exists:
If you don't have the default library, the output will look like this:
If that is the case, you do not need to continue with this article.
However, if the output looks something like this:
Then please keep working.
Step 2) Next, see if the old directory is a symlink to the new default directory. Use this command:
If it is a symlink to the new directory, your output will be similar to this:
If the old directory is a symlink to the new default directory, then you are all set. You can stop here. However, if your output looks more like this:
then you do not have the directory symlinked correctly. Please continue with the steps to fix the issue.
Step 3) Stop Apache. This will make your web site unavailable, so please schedule this activity for a suitable time. You can stop the ZENDSVR6 instance of Apache using this CL command:
Step 4) Rename the /usr/local/zendsvr6/share/ToolkitApi directory using the mv command, to save it. In the PASE shell:
Step 5) Create the symlink. In the PASE shell:
Step 6) If any changes had been made to the toolkit.ini file, you will need to make those same changes to the toolkit.ini file in /usr/local/zendsvr6/var/libraries/PHP_Toolkit_for_IBMI_i/default if you want them to remain in effect. You can use the copy of toolkit.ini in the saved copy of the original directory (see Step 4) as a guide. Be aware that any time you change the default version of the library, you will need to redo this step. Please keep a record of change made to toolkit.ini.
Step 7) Start Apache. You can start the ZENDSVR6 instance of Apache using this CL command:
Optional step) After changing the old library directory to be a symlink to the default library directory, you can remove the old library directory from the default PHP include path. To insure backward compatibility, both the new default directory and the old directory are included in the php include_path setting in installations that have been updated from older versions. You can check for this in the Zend Server User Interface, and change it there as well. Navigate to the Overview -> Server Info tab. Using your browser search (usually accessed via ctrl-F or F3), search for 'include_path'. Check to see if the include_path has both the default library and the old library in the path:
Notice that in this example, both the new path (/usr/local/zendsvr6/var/libraries/PHP_Toolkit_for_IBMI_i/default/library) and the old path (/usr/local/zendsvr6/share/ToolkitApi) are in the include_path. You can remove the old path. Navigate to the Configurations -> PHP tab. This tab shows a list of extensions and other configurable parts of PHP. Find 'Paths and Directories' on the list, and click it to expand the list of directives. Find 'include_path' on the list. Click in the text entry for include_path to position your cursor. Use the right arrow key to move the cursor all the way out to the end of the entry. You cannot see the whole entry, so this part requires taking some care. Make sure your cursor is positioned at the end of the /usr/local/zendsvr6/share/ToolkitApi path, and then use the back key to delete it one character at a time. Also delete the colon that preceded the directory. DON'T GO TOO FAR. You just want to remove this one directory and the colon that precedes it. After making the change, click the Save button in the upper left.
Restart Apache for the change to take effect.