I've a fascinating problem on my small devoted server (CentOS) with URL loading functions. Essentially, all of them work ok, however when i attempt to load a URL from same domain -- i recieve 404 not found. I believe the url gets transformed into personal files path rather than departing it out of the box.
It is possible to method to override this? (obviously i get access to php.ini and also to whole server itself)
Example code i attempted (assume i am running this code from index.php):
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.mydomain.com/file.php'); curl_setopt($ch, CURLOPT_HTTPGET, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, sprintf("Mozilla/%d.0",rand(4,5))); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_exec($ch); curl_close($ch);
This spits out a 404 Not Found /file.php
Yes, it really works should you load this URL from another domain. But when you load it from same domain (i.e. load domain.com/file.php from domain.com/index.php) it does not wish to.
Around the server domain resolves just like from the PC (totally exact Insolvency practitioners)