PHP max_execution_time error with Drupal and XAMPP
I recently had a problem where PHP was timing out at 60 seconds when running a Drupal site using XAMPP on Windows (yeah I know, Windows and XAMPP sucks). I tried changing my php.ini file to 240 seconds, but it made no difference, it would still time out at 60 seconds. Here are the steps I made to fix this issue.
- Set the php.ini max execution time to 240:
- max_execution_time = 240 ;
- Restarted Apache (still timing out at 60 seconds)
- Did a search for any other php.ini files None were found, but if they were, remove to avoid conflicts (or change the max execution time there as well)
- In Drupal's settings.php, add the following:
- ini_set('max_execution_time', 0);
This final step solved the issue for me. 0 sets the max execution time to unlimited
If you are using PHP 5.1.3, check out this bug:
If you liked this, you'll love my book, Master Drupal Module Development.
"..the must have drupal developers book"
Feeling stuck with Drupal 8 module dev?
Get the free 7 lesson course that will help you get started today without feeling overwhelmed.
- Create Drupal modules with just a few commands using the Drupal Console
- Create custom pages
- Create custom blocks
- Create admin forms
- Demystify routers and controllers
- Bonus material