php file_get_contents returns null when allow_url_fopen is on
问题 I get the warning message: file_get_contents failed to open stream permission denied I have set all_url_open to on in the php.ini file. My php file is in my apache server and it is trying to access a url (that returns JSON) from a tomcat server on the same machine. The code in the php file looks like: $srcURL = 'http://samemachine:8080/returnjson/'; $results = file_get_contents($srcURL); I have also tried curl and it returns nothing and doesn't hit the tomcat server either: function curl($url