0

Here's a short back story for context: - Had a site hosted on a solaris machine, had a script that generated a report (pulled data from mysql, generally took ~60 seconds). Everything worked fine. - Migrated that site and db to Ubuntu machines. Now, the script times out after 30 seconds.

Steps I've already taken:

  • Increased the max_execution_time to 3600 (I know it's high as hell, but that's what it was set to on the old solaris box)
  • Set max_input_time = -1
  • set memory_limit = 64MB

I've checked through phpinfo() that these changes are being accepted and show as the current configuration.

As hard as I pray, as crossed as I can get my fingers, or as many times as I can run the script over and over again...I still get the same result - 30 seconds, it seemingly times out, and tosses a 500 error back at me.

Thoughts? Thanks!

5
  • Is it timing out, or getting a 500 error? Have you enabled all error reporting in your php.ini as well? Commented Aug 24, 2011 at 23:35
  • where are you running the script from? Commented Aug 24, 2011 at 23:50
  • Can you post any of the code? Is it running in a loop? If it is, try timing one iteration? Commented Aug 25, 2011 at 0:52
  • Running the script from the admin page of our website. It's supposed to generate a report, so it takes in a start date and end date, and gathers certain data from between them. It's a complex query on a large table, so the query takes a while. Plus, it's crunched through with php to generate readable results. I'm getting the 500 error on Chrome, Firefox just throws up a blank page. And it's always happening right at 30 seconds. Commented Aug 25, 2011 at 14:11
  • I did not see that you were getting a 500 error. That means something is blowing up inside apache. Often in situations like this it indicates that it is running out of memory. Up the memory limit to 256m and if that fixes it you can work back down to something more limited. Commented Aug 25, 2011 at 21:36

2 Answers 2

3

Double check your configuration. If this is being run as a CLI script then some distros have taken to seperating config files in separate directories to have different configuration values for CLI vs web/mod_php. You can run php -i from the command line to see what the CLI environment is configured to do.

Sign up to request clarification or add additional context in comments.

Comments

0

First you need to be sure if mysql or php is restricting the time. If it's PHP set_time_limit(0) does it well. A mysql abortion would propably lead into an unexpected result. For your 500 PHP should be responsible.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.