I am using Virtuablbox. On my host I am running a PHP application that should connect to another application on my guest's web server.
I am using ip when trying to connect.
I can connect to exactly the same URL form the browser and it works.
From PHP I can connect to URLs on the internet with success.
I need som help with ideas (or solutions) what the problem can be. Directions to look for a solution is also fine. I find it very difficult to find a solution.
Exact error message:
[Sat Jul 30 19:35:10 2011] [error] [client ::1] PHP Warning: fopen(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Library/WebServer/Documents/SMICTestProject/test.php on line 10
[Sat Jul 30 19:35:10 2011] [error] [client ::1] PHP Warning: fopen(http://\xef\xbb\xbf192.168.1.105/otrs/test.pl): failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Library/WebServer/Documents/SMICTestProject/test.php on line 10
This is my PHP-file running on the host:
<?php
$handle = fopen("http://192.168.1.105/otrs/test.pl", "r");
if(!$handle){
echo "Failed";
}else{
echo "Succeeded";
}
?>
The file I'm trying to connect to is a PERL file.
Guest is using OpenSUSE/Apache.
My host is Mac OsX and I'm using apache for PHP as well.
"allow_url_fopen = On" in php.ini.
Thank you in advance!