linux环境 php53安装saprfc扩展
oms中间件 推送sap数据 需要用到这个扩展
文件网上比较难找 可以直接百度云盘下载 链接:https://pan.baidu.com/s/1976zC1_q3h148pHs4xTWHw
提取码:yvvo
tar zxvf rfcsdk.tar.gz
mv rfcsdk /usr/local/
export SAPRFC_DIR=/usr/local/rfcsdk/
export PATH=$SAPRFC_DIR/bin:$PATH
mkdir saprfc-1.4.1.All
cd saprfc-1.4.1.All
unzip ../saprfc-1.4.1.All.zip
/usr/local/php53/bin/phpize
./configure --with-php-config=/usr/local/php53/bin/php-config
make && make install
vim /usr/local/php53/etc/php.ini (加上extension=saprfc.so)
###重启php /etc/init.d/php53 restart
没有出现问题最好 saprfc扩展安装完成
如果有问题可以看下面的
/etc/init.d/php53 restart
有问题。。 NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
yum install -y compat-libstdc++-33
###然后重启php saprfc扩展可以了
具体报错解决执行记录
[root@localhost ~]# /etc/init.d/php53 restart
Gracefully shutting down php-fpm . done
Starting php-fpm [19-Jun-2020 19:08:40] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
<br />
<b>Warning</b>: PHP Startup: Unable to load dynamic library '/usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in <b>Unknown</b> on line <b>0</b><br />
done
You have new mail in /var/spool/mail/root
[root@localhost ~]# yum install compat-libstdc++-33
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
compat-libstdc++-33 x86_64 3.2.3-72.el7 base 191 k
Transaction Summary
=============================================================================================================================================================================================================================================
Install 1 Package
Total download size: 191 k
Installed size: 811 k
Is this ok [y/d/N]: y
Downloading packages:
compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm | 191 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64 1/1
Verifying : compat-libstdc++-33-3.2.3-72.el7.x86_64 1/1
Installed:
compat-libstdc++-33.x86_64 0:3.2.3-72.el7
Complete!
You have mail in /var/spool/mail/root
[root@localhost ~]# /etc/init.d/php53 restart
Gracefully shutting down php-fpm . done
Starting php-fpm done
[root@localhost ~]# /usr/local/php
php/ php53/ php56zts/ php72/
[root@localhost ~]# /usr/local/php53/bin/php -i|grep saprfc
saprfc
######另外或许 function_entry需要改为 zend_function_entry 或许不必要 仅做下记录
vim src/saprfc-1.4.1/saprfc.c
47 zend_function_entry saprfc_functions[] = {
另外走的弯路 装的yum install -y compat-libstdc++-33-3.2.3-72.el7.i686 这个是不行的
[root@localhost saprfc-1.4.1]# make test
Build complete.
Don't forget to run 'make test'.
PHP Warning: PHP Startup: Unable to load dynamic library '/root/src/saprfc-1.4.1/modules/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/root/src/saprfc-1.4.1/modules/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/root/src/saprfc-1.4.1/modules/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/root/src/saprfc-1.4.1/modules/saprfc.so' - libstdc++.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
=====================================================================
PHP : /usr/local/php53/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.27
ZEND_VERSION: 2.3.0
PHP_OS : Linux - Linux localhost.localdomain 3.10.0-862.9.1.el7.x86_64 #1 SMP Mon Jul 16 16:29:36 UTC 2018 x86_64
INI actual : /root/src/saprfc-1.4.1/tmp-php.ini
More .INIs :
CWD : /root/src/saprfc-1.4.1
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2020-06-19 15:31:14
=====================================================================
No tests were run.
[root@localhost saprfc-1.4.1]# yum whatprovides libstdc++.so.5
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
compat-libstdc++-33-3.2.3-72.el7.i686 : Compatibility standard C++ libraries
Repo : base
Matched from:
Provides : libstdc++.so.5
compat-libstdc++-33-3.2.3-72.el7.i686 : Compatibility standard C++ libraries
Repo : @base
Matched from:
Provides : libstdc++.so.5
You have mail in /var/spool/mail/root
[root@localhost saprfc-1.4.1]# yum install -y compat-libstdc++-33-3.2.3-72.el7.i686
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
docker-ce-nightly | 3.5 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
docker-ce-test | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
zabbix | 2.9 kB 00:00:00
zabbix-non-supported | 951 B 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
Package compat-libstdc++-33-3.2.3-72.el7.i686 already installed and latest version
Nothing to do
可参考:https://www.rgiapratama.net/2011/08/22/saprfc-php-5-2-10-centos-5-4-64bit/