angela 发表于 2018-12-20 08:39:57

Linux系统上银行支付接口php

  由于一客户需要与银行的网银支付系统进行对接,需要的让系统中php程序支持java, php-java-brige是php众多拓展模块(功能)中的一个,安装此模块之后,php就能自动调用Java语言编写的文件了,才能完成支付功能,下面对此情况进行简单说明:
  



软件
路径
版本


apache
/usr/local/apache
2.2.22


php
/usr/local/php
5.3.10


jdk
/usr/local/java
1.6.0_25


java-bridge

5.5.4.1





一、安装jdk




[*]# chmod +x jdk-6u25-linux-x64.bin
[*]# ./jdk-6u25-linux-x64.bin
[*]# ln -sv jdk1.6.0_25 java
[*]# vim /etc/profile//在最后添加一下内容
[*]JAVA_HOME=/usr/local/java
[*]# . !$   //重新加载一下文件
[*]. /etc/profile



二、安装phpDocumentor






[*]# wget http://pear.php.net/go-pear.phar
[*]# /usr/local/php/bin/php go-pear.phar
[*]Below is a suggested file layout for your new PEAR installation.To
[*]change individual locations, type the number in front of the
[*]directory.Type 'all' to change all of them or simply press Enter to
[*]accept these locations.
[*]
[*]1. Installation base ($prefix)                   : /usr/local/php
[*]2. Temporary directory for processing            : /tmp/pear/install
[*]3. Temporary directory for downloads             : /tmp/pear/install
[*]4. Binaries directory                            : /usr/local/php/bin
[*]5. PHP code directory ($php_dir)               : /usr/local/php/lib/php
[*]6. Documentation directory                     : /usr/local/php/docs
[*]7. Data directory                              : /usr/local/php/data
[*]8. User-modifiable configuration files directory : /usr/local/php/cfg
[*]9. Public Web Files directory                  : /usr/local/php/www
[*]10. Tests directory                               : /usr/local/php/tests
[*]11. Name of configuration file                  : /usr/local/php/etc/pear.conf
[*]
[*]1-11, 'all' or Enter to continue: //此处你可以根据自己的情况进行修改,当然我这就直接默认了,直接回车!
[*]
[*]# /usr/local/php/bin/pear channel-update pear.php.net   //更新一下pear.php.net
[*]Updating channel "pear.php.net"
[*]Channel "pear.php.net" is up to date
[*]
[*]# /usr/local/php/bin/pear PhpDocumentor//安装phpdocumentor,此过程会自动从网上下载包进行解压和安装。
[*]Command 'PhpDocumentor' is not valid, try 'pear help'
[*]# /usr/local/php/bin/pear install PhpDocumentor
[*]WARNING: "pear/PhpDocumentor" is deprecated in favor of "channel://pear.phpdoc.org/phpdocumentor"
[*]Did not download optional dependencies: pear/XML_Beautifier, use --alldeps to download automatically
[*]pear/PhpDocumentor can optionally use package "pear/XML_Beautifier" (version >= 1.1)
[*]downloading PhpDocumentor-1.4.4.tgz ...
[*]Starting to download PhpDocumentor-1.4.4.tgz (1,534,088 bytes)
[*]..............................................................................................................................................................................................................................................................................................................done: 1,534,088 bytes
[*]install ok: channel://pear.php.net/PhpDocumentor-1.4.4   //显示此内容表示安装OK!



三、修改PATH环境变量:




[*]# vim /etc/profile添加一下内容:
[*]PATH=$PAHT:/usr/local/php/bin
[*]# source /etc/profile



四、安装php-java-bridge




[*]# yum install ant -y
[*]# wget http://ncu.dl.sourceforge.net/project/php-java-bridge/RHEL_FC%20SecurityEnhancedLinux/php-java-bridge_5.5.4.1/php-java-bridge_5.5.4.1.tar.gzge.jar
[*]# tar xf php-java-bridge_5.5.4.1.tar.gz
[*]# cd php-java-bridge-5.5.4.1/
[*]# /usr/local/php/bin/phpize
[*]Configuring for:
[*]PHP Api Version:         20090626
[*]Zend Module Api No:      20090626
[*]Zend Extension Api No:   220090626
[*]# ./configure --with-java=/usr/local/java --with-php-config=/usr/local/php/bin/php-config
[*]# make
[*]……
[*]Build complete.
[*]Don't forget to run 'make test'.      //显示这些内容可以make install了
[*]# make install
[*]Installing shared extensions:   /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
[*]
http://blog.运维网.com/attachment/201209/175017180.jpg



五、接下来配置php的配置文件




[*]# vim /usr/local/php/etc/php.ini// 在最后添加一下内容
[*]
[*]java.java_home="/usr/local/java"
[*]java.java="/usr/local/java/jre/bin/java"
[*]java.log_file="/var/log/php-java-bridge.log"
[*]java.classpath="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/JavaBridge.jar"
[*]java.libpath="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
[*]extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
[*]extension=java.so

六、使用phpinfo进行测试

一切配置好后重启一下apache,在浏览器和查看phpinfo的测试页面


http://blog.运维网.com/attachment/201209/175126794.jpg
  整个过程配置完成!



页: [1]
查看完整版本: Linux系统上银行支付接口php