I have this soap request I am working on. I am using wsdl to send the requests and all is good when I do it from my local machine(the development environment). The problem is when I move the same file to the live server (Centos) then I get Could not connect to host
error.
NB both machines are on different networks and the location is the same and both have the php-soap extention installed. Here is my sample code. $end_p = "http://example.com/service/services/test";
$client->__setLocation($end_p);
Here is a list of php extensions installed on the live machine: [root@localhost html]#
php -m [PHP Modules]
bz2,calendar,Core,ctype,curl,date,ereg,exif,fileinfo,filter,ftp,gette,xt,gmp,hash,iconv,json,libxml,mhash,mysql,mysqli,openssl,pcntl,pcre,PDO,pdo_mysql,pdo_sqlite,Phar,readline,Reflection,session,shmop,SimpleXML,soap,sockets,SPL,sqlite3,standard,tokenizer,xml,zip,zlib
[Zend Modules]
Based on the information within the question, it sounds like it could be a firewall issue. CentOS has a default firewall called Selinux and this might be preventing your connection to the other server. As the root user, you can check the Selinux enforcement by running the command: getenforce
. Be default it should be "enforced". To check if selinux is the problem, run the command setenforce 0
to set it to permissive. If there are still problems, try to get as much log info as possible that may provide an error code or reason it cannot connect to the host.