note 27305 deleted from ref.pfpro by danbrown

From: Date: Fri, 26 Sep 2008 15:20:40 +0000
Subject: note 27305 deleted from ref.pfpro by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-144779@lists.php.net to get a copy of this message
Note Submitter: mike at 3mediaweb dot com ---- After searching high and low for a way to get payflow pro to work with my existing servers (other than calling the pfpro binary), I found there was a way I could get it installed on my freebsd apache-mod_ssl servers. I did it via cgi version of php. 1. put freebsd version of libpfpro.so, and pfpro.h in one place. I chose /usr/local/lib/. 2. download the last version of php. 3. ./configure \ --prefix=/usr/local/php \ --with-config-file-path=/usr/local/php \ --with-pfpro=shared,/usr/local/lib/ \ --enable-discard-path \ --with-mcrypt=/usr/local \ --with-mhash=/usr/local \ --with-mysql=/usr/local \ --with-expat-dir=/usr/local \ --enable-wddx \ 4. make && make install .. 5. copy php.ini-dist to your prefix'd location. edit the safe modes and base directories and any other security precautions you need. I also put a link in /usr/bin/ to php so the paths would work. 6. In your php file you will have to edit the loadable modules directory. mine ended up being : /path/lib/php/extensions/no-debug-non-zts-20020429/ browse down to the loadable extentions and add: extension=pfpro.so 7. Open up your httpd.conf add: AddHandler cgi-script xphp to a virtual host Directory or your cgi-bin: I used xphp but you can use what you like for a file extention. You can create a directory like /auth/ but then you will have to put a Options ExecCGI on that folder in order to execute the script. 8. create a test.xphp file and put a #!/pathto/php before the <? phpinfo(); ?> 9. Restart apache to load the Directory directives, and open a browser and browse to the file. If you see any headers on the top of the page, check your error log. if all goes smoothly you should'nt see any errors in the httpd-error_log. I like to tail -f http-error_log in one console and browse it in real time. 10. create a payflowpro.php in the same manner. make sure you put a: putenv("PFPRO_CERT_PATH=/pathto/certs"); and try the pfpro_init(); function. if the function does'nt exist it will fail, which means you have to go back and check stuff for errors. .. Warning: This is the way I found to get the job integrated. It may or may not work on all freebsd systems. Also keep in mind that the cgi version of the php scripts need to be chmod'd to the right permissions, safe_mode and disable functions that are not being used. It may not be the best way, but at least you still have access to the tools that php has build in. .. If I missed something big here let me know.

« previous php.notes (#144779) next »