Setting up Cybersource with PHP API

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 ( When I use the PHP function dl(‘path/to/’) 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?

We have such problems as you described. We also are trying to set up CyberSource on Dreamhost, and we can’t add the directory containing the dynamic libraries to LD_LIBRARY_PATH. We compiled own php build with php.ini file, but we faced with the problems of LD_LIBRARY_PATH.

You wrote that you change LD_LIBRARY_PATH by adding it to .bash_profile. Can you describe how did you make it? I havn’t found anything about it on Dreamhost KBase/Forums/Wiki. Are we able to add just something like that

export LD_LIBRARY_PATH=/home/.errol/user/etc/_ss/lib/:$LD_LIBRARY_PATH


Also you wrote that you have other problems with libraries. Did you solve it successfully? How did you solve it?

Please, if it isn’t complicated for you, describe how we can set up CyberSource with PHP API on Dreamhost hosting.


I have installed the CyberSource PHP Simple Order API and when i am testing nvp\authCaptureSample.php from thecommand prompt. I get the following error message:

RunTransaction Status: 2

The following error occurred while sending the request:

7 : Connect failed; Host unreachable

Please help me to solve this issue because its working successful in your command prompt.


The post you replied to was made 4 years ago.

If the script is requesting files from an online repository of some description, check …\nvp\authCaptureSample.php for the URL it’s seeking and test that the URL is still actually valid.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost