我有初始化SoapClient的非典型问题。我正在运行我的VPS: CentOS版本6.6(最终版) - 64位
我已经安装了PHP:
[root@hostname tmp]# php --version
PHP 5.4.42 (cli) (built: Jun 10 2015 14:19:12)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
和php-soap:
[root@hostname tmp]# yum install php-soap
Package php-soap-5.3.3-40.el6_6.x86_64 is already installed.
推荐:php -m显示:
[root@hostname tmp]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
json
libxml
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
phalcon
Phar
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
zip
zlib
此外,我已经运行了phpinfo()
当我使用时,一切正常:(作为test.php)
<?php
$client = new SoapClient();
var_dump($client);
它回复:
[root@hostname tmp]# vim test.php
[root@hostname tmp]# /usr/bin/php test.php
PHP Fatal error: SoapClient::SoapClient(): Invalid parameters in /var/www/app/library/Soap/test.php on line 3
PHP Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient(): Invalid parameters in /var/www/app/library/Soap/test.php:3
Stack trace:
#0 /var/www/app/library/Soap/test.php(3): SoapClient->SoapClient()
#1 {main}
thrown in /var/www/app/library/Soap/test.php on line 3
Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient(): Invalid parameters in /var/www/app/library/Soap/test.php:3
Stack trace:
#0 /var/www/app/library/Soap/test.php(3): SoapClient->SoapClient()
#1 {main}
thrown in /var/www/app/library/Soap/test.php on line 3
所以它有效。但是当我尝试太开放的视图时:localhost / test.php
Fatal error: Class 'Vokuro\Soap\SoapClient' not found in
你有什么想法吗?
答案 0 :(得分:0)
您在SoapClient();
中没有参数尝试使用WSDL或null和location / uri PHP手册中的更多信息: http://php.net/manual/en/soapclient.soapclient.php
答案 1 :(得分:0)
根据错误消息,我确实认为您正在尝试从不存在的命名空间创建SoapClient对象。
如果代码只是创建和转储类实例,我会定义检查HTTP server / php.ini / php-fpm configs。
您是否确定在代码中不包含此框架中的文件: https://github.com/phalcon/vokuro
也许清除WWWRoot目录会有帮助吗?