Jump to content

PHP Large Script Processing... Error 404 page...


rckehoe

Recommended Posts

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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!

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.