2012-06-13 34 views
9

Tôi muốn bật SOAP trên máy chủ PHP5/Centos/Apache của mình. Tôi có toàn quyền truy cập vào máy chủ. Tệp php.ini của tôi bao gồm bên dưới. Khi tôi nhìn vào phpinfo(), nó không tham khảo SOAP. Bất kỳ đề xuất? Cảm ơn bạnbật SOAP trên PHP

[soap] 
; Enables or disables WSDL caching feature. 
soap.wsdl_cache_enabled=1 
; Sets the directory name where SOAP extension will put cache files. 
soap.wsdl_cache_dir="/tmp" 
; (time to live) Sets the number of second while cached file will be used 
; instead of original one. 
soap.wsdl_cache_ttl=86400 

EDIT - Lấy thông tin sau. Đã thử nó trên hai máy chủ khác nhau.

[[email protected] ~]# yum install php-soap 
Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* base: mirrors.ecvps.com 
* extras: mirror.spro.net 
* rpmforge: mirror.hmc.edu 
* updates: centos.mirror.facebook.net 
Setting up Install Process 
Resolving Dependencies 
--> Running transaction check 
---> Package php-soap.x86_64 0:5.1.6-34.el5_8 set to be updated 
--> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php-soap 
--> Finished Dependency Resolution 
php-soap-5.1.6-34.el5_8.x86_64 from updates has depsolving problems 
    --> Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-soap-5.1.6-34.el5_8.x86_64 (updates) 
Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-soap-5.1.6-34.el5_8.x86_64 (updates) 
You could try using --skip-broken to work around the problem 
You could try running: package-cleanup --problems 
         package-cleanup --dupes 
         rpm -Va --nofiles --nodigest 

EDIT THỨ HAI PHẦN 1

[[email protected] ~]# yum --enablerepo=webtatic install php-soap 
Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* base: mirrors.ecvps.com 
* extras: mirrors.ecvps.com 
* rpmforge: mirror.hmc.edu 
* updates: mirror.5ninesolutions.com 
adobe-linux-x86_64          | 951 B  00:00 
base              | 1.1 kB  00:00 
extras             | 2.1 kB  00:00 
rpmforge             | 1.9 kB  00:00 
updates             | 1.9 kB  00:00 
webtatic             | 951 B  00:00 
webtatic/primary           | 40 kB  00:00 
webtatic                182/182 
Setting up Install Process 
Resolving Dependencies 
--> Running transaction check 
---> Package php-soap.x86_64 0:5.3.13-1.w5 set to be updated 
--> Processing Dependency: php-common = 5.3.13-1.w5 for package: php-soap 
--> Running transaction check 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-cli 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-mysql 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-xml 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-imap 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-odbc 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-xmlrpc 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-ldap 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-pdo 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-gd 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-mbstring 
--> Processing Dependency: php-common = 5.3.4-1.w5 for package: php-mcrypt 
---> Package php-common.x86_64 0:5.3.13-1.w5 set to be updated 
--> Running transaction check 
--> Processing Dependency: php = 5.3.4-1.w5 for package: php-devel 
---> Package php.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-cli.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-gd.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-imap.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-ldap.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-mbstring.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-mcrypt.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-mysql.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-odbc.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-pdo.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-xml.x86_64 0:5.3.13-1.w5 set to be updated 
---> Package php-xmlrpc.x86_64 0:5.3.13-1.w5 set to be updated 
--> Running transaction check 
---> Package php-devel.x86_64 0:5.3.13-1.w5 set to be updated 
--> Finished Dependency Resolution 

Dependencies Resolved 

================================================================================ 
Package    Arch   Version    Repository  Size 
================================================================================ 
Installing: 
php-soap    x86_64   5.3.13-1.w5   webtatic   144 k 
Updating for dependencies: 
php     x86_64   5.3.13-1.w5   webtatic   1.4 M 
php-cli    x86_64   5.3.13-1.w5   webtatic   2.6 M 
php-common   x86_64   5.3.13-1.w5   webtatic   653 k 
php-devel   x86_64   5.3.13-1.w5   webtatic   622 k 
php-gd    x86_64   5.3.13-1.w5   webtatic   107 k 
php-imap    x86_64   5.3.13-1.w5   webtatic   50 k 
php-ldap    x86_64   5.3.13-1.w5   webtatic   35 k 
php-mbstring   x86_64   5.3.13-1.w5   webtatic   1.2 M 
php-mcrypt   x86_64   5.3.13-1.w5   webtatic   30 k 
php-mysql   x86_64   5.3.13-1.w5   webtatic   91 k 
php-odbc    x86_64   5.3.13-1.w5   webtatic   50 k 
php-pdo    x86_64   5.3.13-1.w5   webtatic   66 k 
php-xml    x86_64   5.3.13-1.w5   webtatic   118 k 
php-xmlrpc   x86_64   5.3.13-1.w5   webtatic   50 k 

Transaction Summary 
================================================================================ 
Install  1 Package(s) 
Upgrade  14 Package(s) 

Total download size: 7.1 M 
Is this ok [y/N]: y 
Downloading Packages: 
(1/15): php-mcrypt-5.3.13-1.w5.x86_64.rpm    | 30 kB  00:00 
(2/15): php-ldap-5.3.13-1.w5.x86_64.rpm     | 35 kB  00:00 
(3/15): php-xmlrpc-5.3.13-1.w5.x86_64.rpm    | 50 kB  00:00 
(4/15): php-imap-5.3.13-1.w5.x86_64.rpm     | 50 kB  00:00 
(5/15): php-odbc-5.3.13-1.w5.x86_64.rpm     | 50 kB  00:00 
(6/15): php-pdo-5.3.13-1.w5.x86_64.rpm     | 66 kB  00:00 
(7/15): php-mysql-5.3.13-1.w5.x86_64.rpm     | 91 kB  00:00 
(8/15): php-gd-5.3.13-1.w5.x86_64.rpm     | 107 kB  00:00 
(9/15): php-xml-5.3.13-1.w5.x86_64.rpm     | 118 kB  00:00 
(10/15): php-soap-5.3.13-1.w5.x86_64.rpm     | 144 kB  00:00 
(11/15): php-devel-5.3.13-1.w5.x86_64.rpm    | 622 kB  00:00 
(12/15): php-common-5.3.13-1.w5.x86_64.rpm    | 653 kB  00:01 
(13/15): php-mbstring-5.3.13-1.w5.x86_64.rpm    | 1.2 MB  00:00 
(14/15): php-5.3.13-1.w5.x86_64.rpm      | 1.4 MB  00:02 
(15/15): php-cli-5.3.13-1.w5.x86_64.rpm     | 2.6 MB  00:02 
-------------------------------------------------------------------------------- 
Total           604 kB/s | 7.1 MB  00:12 
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID cf4c4ff9 
webtatic/gpgkey           | 1.6 kB  00:00 


Public key for php-mbstring-5.3.13-1.w5.x86_64.rpm is not installed 

THỨ HAI EDIT PHẦN 2

[[email protected] ~]# yum --enablerepo=webtatic install webtatic-release 
Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* base: mirrors.ecvps.com 
* extras: mirrors.ecvps.com 
* rpmforge: mirror.hmc.edu 
* updates: centos.mirror.facebook.net 
Setting up Install Process 
Resolving Dependencies 
--> Running transaction check 
---> Package webtatic-release.noarch 0:5-2 set to be updated 
--> Finished Dependency Resolution 

Dependencies Resolved 

================================================================================ 
Package     Arch   Version  Repository   Size 
================================================================================ 
Updating: 
webtatic-release   noarch   5-2   webtatic   11 k 

Transaction Summary 
================================================================================ 
Install  0 Package(s) 
Upgrade  1 Package(s) 

Total download size: 11 k 
Is this ok [y/N]: y 
Downloading Packages: 
webtatic-release-5-2.noarch.rpm       | 11 kB  00:00 
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID cf4c4ff9 
webtatic/gpgkey           | 1.6 kB  00:00 


Public key for webtatic-release-5-2.noarch.rpm is not installed 
+0

Bạn đã cài đặt xà phòng php chưa? Chạy 'yum install php-soap' để làm điều đó –

Trả lời

17

Bạn có thể cần phải chắc chắn rằng các gói SOAP PHP được cài đặt. Hãy thử chạy yum install php-soap làm thư mục gốc.

Edit: Phỏng theo excellent answer này cho một câu hỏi tương tự:

chạy này:

yum --enablerepo=webtatic install php-soap 

này cho yum để có được gói từ kho webtatic (ngoài hệ thống kho cấu hình). Nếu bạn muốn webtatic trong kho hệ thống kích hoạt, hãy chạy:

rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy 
yum --enablerepo=webtatic install webtatic-release 
+0

Đã thử nhưng đã ... Thiếu phụ thuộc: php-common = 5.1.6-34.el5_8 là cần thiết bởi gói php-soap-5.1.6-34.el5_8.x86_64 (cập nhật) – user1032531

+2

có vẻ như không khớp giữa phiên bản PHP trên máy chủ của bạn và phiên bản trong yum. Điều này có thể là do repos hỗn hợp - có thể thử một danh sách 'yum có sẵn | grep soap' để xem có các phiên bản xà phòng khác nhau không. –

+0

Hãy cho tôi những điều sau đây: php-soap.x86_64 5.1.6-34.el5_8 cập nhật php53-soap.x86_64 5.3.3-7.el5_8 cập nhật python-soap.noarch 0.11.6-1.el5.rf rpmforge soapbox.x86_64 0.3.1-1.2.el5.rf rpmforge – user1032531

0

Trong trường hợp đó bạn có Ubuntu trong máy tính của bạn hãy thử như sau trong terminal của bạn:

  1. sudo apt-get install php-xà phòng
  2. dịch vụ apache2 restart

Để kiểm tra sử dụng tập tin thử nghiệm php bên trong nó chỉ có chức năng sau phpinfo(); và kiểm tra kết quả trong trình duyệt chứa mô-đun sau giống như hình ảnh đó: enter image description here