dflow Posted June 10, 2009 Share Posted June 10, 2009 is there a way to speed up the get url? for some reason $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; takes a very long execution time i want to get the contents of a file on the same server but it dies out Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/ Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Can we see more of your code? There is a multitude of reasons that could cause this. Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-853164 Share on other sites More sharing options...
dflow Posted June 15, 2009 Author Share Posted June 15, 2009 Can we see more of your code? There is a multitude of reasons that could cause this. here is the code before this i create the html file no bigger than 65 k, it is a preview and then it should be saved for future sending etc. <?php //url vars: $urlRID = $_GET['RequestID']; $urlSupID = $_GET['SupID']; $urlPID = $_GET['PID']; $urlpar = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // submit query to search engine $url_contents ="http://mysite:xxxx@$urlpar "; $query_file_content = file_get_contents($url_contents, "r") or die("cannot open url"); // save results to a local file // folder 777 permission $filenameSV = 'COMMITMENT_FORM_'; $filenameLN = $_GET['LN']; $filenameRID = $_GET['RequestID']; $filetype = '.htm'; $file = fopen('../backoffice/createdfiles/'.$filenameSV.''.$filenameLN.''.$filenameRID.''.$filetype.'', 'w+'); fwrite ($file, $query_file_content); fclose($file); ?> Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-856180 Share on other sites More sharing options...
Andy-H Posted June 15, 2009 Share Posted June 15, 2009 <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); //url vars: $urlRID = $_GET['RequestID']; $urlSupID = $_GET['SupID']; $urlPID = $_GET['PID']; $urlpar = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // submit query to search engine $url_contents ="http://mysite:xxxx@" . $urlpar; $query_file_content = file_get_contents($url_contents) or die("cannot open url"); // save results to a local file // folder 777 permission $filenameSV = 'COMMITMENT_FORM_'; $filenameLN = $_GET['LN']; $filenameRID = $_GET['RequestID']; $filetype = '.htm'; $file = fopen("../backoffice/createdfiles/" . $filenameSV . $filenameLN . $filenameRID . $filetype, 'w+'); fwrite ($file, $query_file_content); fclose($file); ?> Try that? http://php.net/file_get_contents Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-856184 Share on other sites More sharing options...
dflow Posted June 15, 2009 Author Share Posted June 15, 2009 same 500 server error loads forever Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-856232 Share on other sites More sharing options...
Maq Posted June 15, 2009 Share Posted June 15, 2009 same 500 server error loads forever Can you post exactly what the error says? Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-856235 Share on other sites More sharing options...
dflow Posted June 15, 2009 Author Share Posted June 15, 2009 Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. Error 500 mysite.com Mon Jun 15 17:01:29 2009 Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7e mod_auth_pgsql/2.0.3 Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-856300 Share on other sites More sharing options...
wildteen88 Posted June 15, 2009 Share Posted June 15, 2009 You need to look in your servers error log to see why you are receiving the 500 Internal Server Error. Quote Link to comment https://forums.phpfreaks.com/topic/161694-is-there-a-way-to-speed-up-the-get-url/#findComment-856373 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.