Setting up Cybersource with PHP API
Posted by: upstateny
Posted on: 2005-01-12 08:45:00
I am building a shopping cart using the CyberSource payment gateway. CyberSource requires you to make changes to the php.ini file, load a dynamic library for their PHP4 API, and change the server variable LD_LIBRARY_PATH to the directory where their additional libraries live.
After trying to install my own PHP binary, reviewing logs from tests, etc. I found out that I don't need my own PHP binary, I can create my own php.ini (actually named 'php-cgi.ini') file that gets concatenated on to the Dreamhost php.ini file (the php-cgi.ini file needs to live in the same directory as the script that is using it), and I was able to change LD_LIBRARY_PATH for my account by adding it to .bash_profile in my home directory.
Here are my problems: When I run the php script that makes a test order from the command line it works fine:
php authCaptureSample.php
and it returns all of the request data from CyberSource. However, when I try to load that same page from a browser it doesn't work, saying that it can't find that functions that need to be loaded from the CyberSource PHP4 library file (php4_cybersource.so). When I use the PHP function dl('path/to/php4_cybersource.so') it seems to work, but then it's looking for the other CyberSource library files. When I try loading the required library using dl() again, it says its not a PHP library. When I try the transaction from the command line, it still works.
Any suggestions?