I am unable to make a php curl request with port number , without port number i am getting response properly.
Through terminal when i do curl http://www.sample.com
Add
curl_setopt($ch, CURLOPT_PORT, 8088);
Curl_setopt reference
Try to set
curl_setopt($ch,CURLOPT_PORT, 8088);
See more info http://php.net/manual/en/function.curl-setopt.php
Try to set the port like this:
curl_setopt($ch, CURLOPT_PORT, $_SERVER['SERVER_PORT']);
or:
curl_setopt($ch, CURLOPT_PORT, 8088);
Make sure that the port 8080 is enabled in Cent OS
and try this curl_setopt($ch, CURLOPT_PORT, 8088);
I went to server admin with this problem and he changed configuration in centos
in folder /etc/sysconfig/
he edited file selinux and change SELINUX=disabled and restated it.
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
and my problem got solved.
"setsebool httpd_can_network_connect on" resolves the problem for me