I encountered this problem ages ago, and solved it (I think) but I remember it driving me nuts then, and it's driving me nuts again!
I am trying to obtain a remote page and reading it to extract essential info. I settled for file() in the end, but it fails on some sites.
code eg:
$remote_url="http://some.site.com";
$url=file($remote_url);
$code=implode('', $url);
print($code);
Now, when $remote_url is "http://www.apple.com", the file is read, but when it is "http://www.google.com" I get an error saying the attempt to load the page failed. It's pretty much 50-50 when I chose websites at random as to whether they will load.
Any thoughts as to why?
If it's any use, a verbose httpd error log on the server reports:
Command: httpd
PID: 1466
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x0000001c
Thread 0:
#0 0x002a3dcc in php_network_getaddresses
#1 0x002a4088 in php_hostconnect
#2 0x002fcc78 in php_fopen_url_wrap_http
#3 0x002a0b5c in php_fopen_url_wrapper
#4 0x002a02f4 in php_fopen_wrapper
#5 0x002ed2f0 in zif_file
#6 0x002804e8 in execute
#7 0x0026bc8c in zend_execute_scripts
#8 0x002a31d4 in php_execute_script
#9 0x0029ea5c in apache_php_module_main
#10 0x0029d508 in send_php
#11 0x0000d204 in ap_invoke_handler
#12 0x0001721c in process_request_internal
#13 0x00017298 in ap_process_request
#14 0x0000663c in child_main
#15 0x000068ac in make_child
#16 0x00006bfc in perform_idle_server_maintenance
#17 0x00007180 in standalone_main
#18 0x00007840 in main
#19 0x000026e4 in _start
#20 0x00002514 in start