Problems with Drupal 8 and optimization in WAMP

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:

and

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:

CapturePHPini-max_execution_time

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:

MyIni-max_allow_packet

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';

CaptureConfig

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.

 

Leave a comment

Por favor, inicia sesión con uno de estos métodos para publicar tu comentario:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s