Today I have been testing the alpha version 3 of Drupal 8 (the latest alpha version available for Drupal, a CMS written in PHP). The installation is very simple (perhaps another day I will explain something about this one), and due that I have new WAMP 2.4 installed since a few days, I detected a couple of problems in the middle of installing Drupal (mainly because I needed do some small changes in the config files):
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://localhost:81/drupal2/core/install.php?langcode=es&profile=standard&id=1&op=do_nojs&op=do StatusText: Internal Server Error ResponseText:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\drupal-8.0-alpha3\core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php on line 132
The easiest is to think it’s a problem of the runtime, and it is. Some people suggest to increase this time to 10 minutes, but it is too long to run a page (I suggest one or two minutes at most, it is boring waiting). Therefore, I propose here two things for do the WAMP server more efficient:
- By increase execution time allowance.
- By increase communication buffer size.
By increase execution time allowance.
For do this one, we must change the variable “max_execution_time” in “php.ini” (initially have a value of 30).
For check and modify this value, you can access to “php.ini” by two ways:
- Left-click on the WAMP Server icon / php / php.ini
- Or directly go to “C:\wamp\bin\php\php5.4.12\php.ini” (maybe your PHP version is different, or you are not using WAMP).
Find the variable “max_execution_time”. In my case, it was using only 30 seconds:
In my case, I put the value of 60 seconds. If your computer is very old, put more time:
max_execution_time = 60
By increase communication buffer size.
By increasing communication buffer size, the whole WAMP server will be faster. We are going to modify the variable “max_allowed_packet” in “my.ini” of MySQL, that controls the maximum size of its communication buffer.
For check and modify this value, you can access to “my.ini” by two ways:
- Left-click on the WAMP Server icon / MySQL / my.ini
- Or directly go to “C:\wamp\bin\mysql\mysql5.6.12\my.ini” (maybe your PHP version is different, or you are not using WAMP).
Find the variable “max_allowed_packet”. In my case, it was using only 1 MB:
In my case, I put the value of 64M, due that I have a powerful computer, and I do not need more memory:
max_allowed_packet = 64M
After these two changes, save the changes and restart WAMP Server for the changes to take effect.
Note: If you use a hosting service.
Moreover, for a hosting service would be advisable to use more MB. Usually, hosting companies do not allow access to “my.ini”, so you could access to the MySQL or phpMyAdmin terminal (in the SQL section), and write the following query:
SHOW VARIABLES LIKE 'max_allowed_packet';
This last result is expressed in bytes, so you have to divide by 1024 twice (in my case, before I was using 1 MB, ie 1048576 bytes (1 * 1024 * 1024)).
For the variable “max_allowed_packet”, I recommend at least 128 or 256M value (the more MB better) for a hosting service.