I have a php script that seems to be timing out. Is there a setting that determines how long a mysql query can last before timing out? If so, where do I find the setting? Should it show up if I include a phpinfo() statement?
PHPRookie wrote:Should it show up if I include a phpinfo() statement?
Should it show up if I include a phpinfo() statement?
Yes (I think virtually all of php.ini is reflected in phpinfo()); searching the page for instances of the word "time" finds it: "max_execution_time" limits how long a PHP script is allowed to run. There is also "mysql.connect_timeout".
How can I tell how long my script is taking to run? Is there something I can put in my code that will show me the errors my script is having?
PHPRookie;10903354 wrote:How can I tell how long my script is taking to run?
How can I tell how long my script is taking to run?
Example #2 Timing script execution in PHP 5 <?php $time_start = microtime(true); // Sleep for a while usleep(100); $time_end = microtime(true); $time = $time_end - $time_start; echo "Did nothing in $time seconds\n"; ?>
PHPRookie;10903354 wrote:Is there something I can put in my code that will show me the errors my script is having?
Is there something I can put in my code that will show me the errors my script is having?
error_reporting(E_ALL);
Much thanks. I will try both of these!