linux環境 php53安裝saprfc擴展

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/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章