On Friday 30 November 2001 00:56, you wrote:
> Hi,
>
> I'm trying to get payflow pro working on my server (unfortunately a client
> took it upon themselves to get their gateway).
>
> I am on a freebsd box and I am having all sorts of problems getting this
> working. Either as an extension (pfpro.so) or just exec() externally.
>
> I've read that Verisign stopped distributing a FreeBSD of their SDK...
> which seems true since it is not offered on their site. So... first I
> downloaded the BSDi SDK. I thought I might be able to hack it up a bit...
> no such luck, as a module or just scripting to it.

They were having problems with the threading system.  Most of FreeBSD is not 
threaded (most people do not build threaded apps by default) and their 
libraries require it...:(

> So, if all else fails go for the linux dist.
> I downloaded, gunziped, and proceeded to make a php extension.
> ./configure --with-pfpro=shared,/usr/local/verisign/payflowpro/linux

You can not use Linux libs in a FreeBSD binary.  You would have to 
compile a Linux binary of PHP.

> Compiles fine... creates pfpro.so. I copy pfpro.so and libpfpro.so (which
> came with the SDK) to /usr/local/lib (this is the lib directory my ini file
> points to, which is where my other extensions are). i copy pfpro.h to
> usr/local/include.
> i add the following to my php script
> dl('pfpro.so');
>
> It won't load... I get a error stating it cannot find libc.so.6. So I copy
> over the lib from the linux compat files to /usr/lib (not usr/local/lib).
> Refresh... apparently it found that, as it is now cannot locate
> ld-linux.so.2 (i think). Again, I copy this from the compat to /usr/lib. I
> am expecting an error, but it tells me it still cannot locate it. I do a
> bunch of steps probably unneccessary just to try everything. I copied this
> to my /usr/local/lib, i run ldconfig, i do a bunch of stuff to no avail.

It would not work anyway.  Again, you can not use Linux libs in a FreeBSD 
binary.  Linux libs belong under /compat/linux/usr/lib or thereabouts.

> Can anyone give me some insight on setting payflow pro up on freebsd as a
> php module?

I could never get the PHP module to work on FreeBSD (4.3 and 4.4).
(I've got the native libs.  The problem is that they have to be linked into
a threaded program.)
I just use the following code:

# Location of the pfpro binary.
$pfpro = "/www2/bin/pfpro";
# Location of the certs
putenv("PFPRO_CERT_PATH=/www2/Verisign.certs");

# The args to call the binary with
$args = "USER=$vsInfo[1]&VENDOR=$vsInfo[1]&PARTNER=verisign&" .
        "PWD=$vsInfo[2]&" .
        "TRXTYPE=S&TENDER=C&" .
        "ACCT=$UserInfo[ccnum]&EXPDATE=$ccexpire&" .
        "AMT=$UserInfo[amount]&COMMENT1=$comment1";
  
# Put together the command string
$command = "$pfpro $vsInfo[3] 443 \"$args\" 10";

$result = `$command`;

Please note the putenv!  You have to have this!
Also look at the back ticks for $result.

This should also work with the Linux binary...

> Now, I know it "can" work. I dropped to my shell, ran
> ..../linux/bin/test.sh. Works... i run ./pfpro as is and it can't find
> libraries (the test.sh script defines their location). So, I decide I'll
> try to hack up something exec(pfpro)'ing from the script, despite i am no
> good at this. i found a snipet of code in the anotated php manual. I could
> not get it to work. I even exec() the same code that defines the libs in
> the shell script (test.sh) before exec() the pfpro call.
>
Install your libs under /compat/linux/usr/lib or somewhere and then update the
ld hints/config file for linux.

The linux program should work fine then.

--SNIP--

Hope this helps.

GB

-- 
GB Clark II             | Roaming FreeBSD Admin
[EMAIL PROTECTED] | General Geek 
           CTHULU for President - Why choose the lesser of two evils?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to