St. George IPG tips for development on Xandros Eee PC
The following article includes generic tips on libssl, libcrypto, PHP extensions and Zend that are not specific to deploying the St. George Internet Payment Gateway API on your development environment.
Just sharing some notes for anyone else who happens to be developing a PHP interface that utilises St. George’s Internet Payment Gateway API on a Xandros Eee PC. Unlikely, I know - but just in case. Plus might be useful for other situations.
OK first up, the downloadable code from St. George contains a libwebpayclient.so file. This is not a file they’ve accidentally named incorrectly. It does not come with a pre-compiled webpay_php.so - you do actually have to make that. Because it’s an .so shared object file it has to be done on Linux - IIS cannot interpret .so files. Neither can IIS handle the dl() function that St. George recommends … which incidentally is not secure as it is vulnerable to code injection and is not available in PHP5 (as far as I know ) and may be disabled in your host’s PHP.ini file in the enable_dl setting.
So you’re on your Linux box … in my case my Xandros Eee PC and after figuring out that I actually need to make another .so file instead of renaming the libwebpayclient.so file - plus a few issues with Apache and Apache2 - it’s the first time I’ve discovered there’s actually separate apachectl and apache2ctl commands - so got that sorted out; running Apache 2.0 and PHP4 and have set up my extensions directory in PHP.ini etc …
OK so you run make in your webpayPHP-2.0 folder that you’ve extracted from the stuff you downloaded from St. George. In my case - got an error because it couldn’t find Zend. To get Zend you need to install php4-dev. To install php4-dev you need libssl-dev. To install libssl-dev you need libssl0.9.8c-4. Which I didn’t have. I had libssl0.9.8e-4. So I had to downgrade by using the Force Version option in Synaptic and choosing the update.eeepc.asus.com repository instead of www.geekconnection.org. Unfortunately there were some side effects from this downgrade, ie losing OpenOffice, File Manager (xandros-explorer) etc - yeah, don’t ask. So I have Zend installed - and had to change the CFLAGS declaration in the Makefile to point to where Zend was installed to - basically changing /php/ to /php4/.
So run make again … and of course considering my day was going so well it decided to just dump the library right there instead of in /usr/lib/php4/libexec/ where I’d set INSTALL_LIB_DIR to in the Makefile. Yeah, whatever.
Oh and don’t forget you need to install SWIG too for all of this.
So - done. webpay_php.so has been made, put in the PHP extensions folder, PHP can see it, loads it, oh and I have an extension=webpay_php.so declaration in my PHP.ini - not sure if it’ll work without that.
Oh yeah and put libwebpayclient.so in /usr/lib/ and also run ldd /usr/lib/libwebpayclient.so to make sure you have all your dependencies otherwise you might get an “There has been an initialisation problem. Please check error log.” error when viewing your test.php or other pages that use the webpay_php.so library. If there are dependency issues it could be as simple as creating symbolic links - so all I had to do was create a symbolic link “libssl.so.4″ to point to libssl.so.0.9.8 and “libcrypto.so.4″ to point to libcrypto.so.0.9.8.






Leave a Reply