rckehoe Posted August 10, 2010 Share Posted August 10, 2010 I have 2 scripts that take a while to process... The first takes a few minutes, the second takes over an hour... The first script completed successfully, but the second script seems like it just stops most of the way through the script... I have this set on both files: set_time_limit(0); ini_set('memory_limit', -1); I NEED to disable ALL time limits and all of that, does ANYONE have any clue as to why my second script is failing? It is NOT the programming, I know that for sure... But the script just stops executing, and I think it is because it times out... But after setting those 2 options, I don't see why it times out.. Also for reference, I am NOT using any database... I am simply downloading files from an FTP server to my server... Any help would be appreciated, I have been searching for the last few days on an answer. Rob Quote Link to comment https://forums.phpfreaks.com/topic/210289-php-large-script-processing-error-404-page/ Share on other sites More sharing options...
trq Posted August 10, 2010 Share Posted August 10, 2010 A 404 means your server cannot find the file requested. Why are you executing these scripts via a web server in the first place? They aren't exactly designed for this. Quote Link to comment https://forums.phpfreaks.com/topic/210289-php-large-script-processing-error-404-page/#findComment-1097396 Share on other sites More sharing options...
rckehoe Posted August 10, 2010 Author Share Posted August 10, 2010 I realize what a 404 means... Question is, why do I get this after 30 minutes of processing a script? and I am not really using a browser.. I am running the script via the command line using WGET and I even tried CURL. Both return a 404 error... Thing is... the page is found just fine, the script stops executing and it gives me that error... Very strange... -- There is no particular reason I am using PHP to do this... Just wanted to. These scripts should technically function the same way anything else does, I don't see why it cannot... Quote Link to comment https://forums.phpfreaks.com/topic/210289-php-large-script-processing-error-404-page/#findComment-1097561 Share on other sites More sharing options...
paulman888888 Posted August 10, 2010 Share Posted August 10, 2010 To comfirm that the page does exist try; put this at the TOP of your code function shutdown() { echo 'This script exists but i am giveing out a 404!'; } register_shutdown_function('shutdown'); If you page does exist it should show you that message if you use cURL otherwise your file doesnt exists and your server is just uber slow! Quote Link to comment https://forums.phpfreaks.com/topic/210289-php-large-script-processing-error-404-page/#findComment-1097629 Share on other sites More sharing options...
trq Posted August 10, 2010 Share Posted August 10, 2010 and I am not really using a browser.. I am running the script via the command line using WGET and I even tried CURL. Both return a 404 error... I never mentioned a web browser. There is no particular reason I am using PHP to do this... Just wanted to. I never asked 'why are you using php?' I asked, 'why are you executing these script via a web server?' These scripts should technically function the same way anything else does, I don't see why it cannot... What exactly is 'anything else'? Web servers are designed to listen for a request and when one is made to fetch and serve the requested resource. Its meant to be a fairly straight forward, fast and simple process. If you have scripts that are taking more than a few seconds hours to complete they shouldn't be getting executed via a request to a web server. Quote Link to comment https://forums.phpfreaks.com/topic/210289-php-large-script-processing-error-404-page/#findComment-1097837 Share on other sites More sharing options...
freeloader Posted August 10, 2010 Share Posted August 10, 2010 Even though you can set it not to time out, there are a number of reasons your script would eventually time out anyway. Your webhost probably overrides your 'unlimited' script time limit constraint. And if it doesn't, your browser might've grown tired of it after a while If you're using WGET or cURL to load the page, make sure the cURL connection itself wasn't timing out. The previous poster is absolutely right though, a script this big should be executed locally. Install php and just run it in command line, you'll be able to run it for as long as you want. Quote Link to comment https://forums.phpfreaks.com/topic/210289-php-large-script-processing-error-404-page/#findComment-1097847 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.