I created a PHP page several months ago that had a lot of file processing to do when it was called... it loaded a very large file into an array, manipulated it, wrote the results to a MySQL table, and created several output .csv files from the data.

Because it takes sometimes 3 - 5 minutes to run, I put a set_time_limit(0); command in the page so that the server would not time out when it was run.

everything worked great for a few months.

now it is timing out the page (even faster than the 30 second default) every time and I don't know what else to do. the hosting company (ipowerweb.com) is not being terribly helpful...

although it seems to me that it almost has to be a change to their server settings (since it was working fine for two months and I didn't change the script!)... but as far as I can tell they are not running 'safe mode' and have not modified any other PHP settings that might interfere or negate the set_time_limit(0) command.

is it possible there is anything I can do in the coding?
could it be a server setting (other than php) that is timing out?

is there anything i can do with .htaccess ?

I think the server is running BSD

    set_time_limit() has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the configuration file.

      I checked the PHP configuration on the hosting company by running

      phpinfo();
      phpinfo(INFO_MODULES);

      but it shows Safe mode as being set to OFF...

      so I don't know why it will not work.

      should I tell you specifically how any of the settings in that report are set? I don't know what else would be causing it.

        Its possible for a host to implement a max executiontime on all scripts in any language, especially if they are running IIS. Just because phpinfo() doesn't indicate that its running in safe mode, doesn't mean they can't stop scripts from running. One of our hosts has a 2 minute time limit on all scripts on their servers.

          So... if they have implimented such a limit... the only way to overcome it is to ask them to change it I suppose.. there is no .htaccess commands I could try are there? I think they are runnung BSD on the server.

            Write a Reply...