Answering users questions about wsf/php installation for many months, I thought it is worth to take some time and make a shortlist of some regular questions asked by them. Actually problems has been occurred not only due to users mistakes in following the installation steps properly, but also due to the status of the systems like already installed old versions, use of different package management tools, mulitple installations of same thing like php/apache and conflicts in libraries. In this little FAQ i’m trying to answer problems users come up with due to all of above mentioned reasons. And feel free to correct me or even add here some entries through comments.
- Where is the installation guide?If you have downloaded the packs (either source or binaries), you can find the installation README in their. README.INSTALL for the linux installation and README.INSTALL_WIN32 for the windows installation.
You can find the online version from http://wso2.org/project/wsf/php/1.3.2/docs/install_guide.html
- I have lot of php.ini files in my system. Which should I edit? (Refers to http://wso2.org/forum/thread/3879)This is because you have many PHP installations in your system, one from deb, one from compiling source another can be from Zend core. Similarly there can be many apache instances as well.
The best way to find the php.ini is to use the php function phpinfo(). For that you have to find the apache web root directory. By default it is ‘/var/www’. If it is not /var/www just find for the directory named htdocs and it can be most probably your web root directory.
Create a php file (say phpinfo.php) with the following lines of code.
<?php phpinfo() ?>
And save the file inside your root web directory and access it though the browser. (most probably it is http://localhost/phpinfo.php)
And search for the entry “Loaded Configuration File”. That is exactly what you were finding for..
- My Web Services Client correctly working on the Command line (using PHP CLI). But the same thing doesn’t work when I put it in the apache server in the same computer and access from a browser. It complains with the error message ‘WSClient’ not found, What can be the problem?The php.ini loaded by the CLI can be different from the one loaded by the server. Just find the correct php.ini loaded by the server. So the answer to this question is same as the answer to the above question.
- My Web Service Client run on the apache server correctly, but doesn’t run on the command line?
There also you need to find the php.ini loaded from the PHP CLI. run the php -i command and check what is the loaded configuration.
- I’m in windows. I have followed all the steps correctly. But php error log always says wsf.dll is not loaded. What may I have missed here?
The first thing you should do is check the PATH variable value from a phpinfo (not from command line), I have mentioned the steps to create phpinfo page in the answer to the question number 2. After that search the entry for PATH variable in the Apache environment section. Just check whether this is the same path that you think you have set. You get this problem mostly because the path loaded by apache is different from what you set. You may mistakenly have set the required library paths to the user environment variable and not to the system environment variable. Or you may have to restart the system to actually update these variable. Try these things until you actually get the PATH you want to have from the phpinfo.
The other possibility is you have a set of old libraries prior to the new libraries in your PATH. This happens mostly if you are upgrading the system from old wsf/php version. If that so make sure you remove the paths of these old libraries from the PATH variable.
And another possibility is the user mistake. Check your libxml, iconv and openssl libraries are actually in the PATH, if not just set it and try.
- All my samples are working except the samples in the wsdl_mode and wsdl_generation directories. Any clue?
You may have missed either
installing, enable php xsl extension
setting the include_path to the scripts directory. (This scripts directory is shipped with every binary and source packs, when you extract these packs the ‘scripts’ directory will be there right in the root directory of the pack.
The other very rare reason would be some compatibility issues on libxml2 version used by dom and the libxml2 version used by the xsl. Apparently if you have libxml2 version 2.6.31 with an older libxml2 version (like 2.6.2*) most probably you will find php crashes when using xsl and dom. See the link http://wso2.markmail.org/message/54yvh2pcowhrj332. This is like fight between dom and xsl for the libxml2 library, if the first one loaded the old version the other one will be down, since it is not compatible with that loaded version. in this situation you have to upgrade either the xsl extension or the dom extension (that mean you better upgrade all the php libraries and binaries)
- I installed apache and php using apt-get command in my ubuntu OS. but when I edit php.ini in the /etc/php5/apache2 directory the configuration are not loaded correctly. What should I do?
This problem can be aroused in any debian based system when you install apache and php from apt-get or with deb. In this case you have to create a file like wsf.ini inside /etc/php5/apache2/conf.d directory and add the wsf specific configuration there.
Remember there you have to install php-xsl package from apt-get or using a deb.
- When I run samples It simply doesn’t work. And there are no complains in the php error log or apache error log, and in phpinfo it shows the wsf is correctly loaded. How can I solve this?
If the wsf is loaded and still the samples fails, the next thing you should do is check out the wsf logs from where you specify to generate in the php.ini (if you didn’t specify it in linux it will be default to /tmp directory). Open the wsf_php_client.log and find the errors and entries in the later part that may have caused the problem. If it say something like client repo doesn’t exists or axis2.xml is failed to load just double check the wsf.home you specified in the php.ini
If you don’t understand whatever the wsf log tell, please put a question in the forum http://wso2.org/forum/188 or put a mail http://wso2.org/mail#WSFPHP with both wsf_php_client.log and wsf_php_service.log attached. (Make sure you delete any sensitive data in the blog)
- Samples says it is working successfully. How can I make sure the clients/services actually sends messages?
Download tcpmon from http://ws.apache.org/commons/tcpmon/download.cgi. You can send the messages through tcpmon and track their content. Just read the tcpmon tutorial and try to get it working.