A Small But Powerful Drupal Lifehack for Installing Drupal Distributions

23 Feb · by Tim Kamanin · 1 min read

Drupal distributions like Open Atrium and Drupal Commons consist of many modules, already preconfigured and installed. During the installation process of such distributions you can encounter several problems related to your server like 'memory limit error' and 'time execution limit'. These are caused by a complex configuration and calculations being performed during the installation of these packages.

To secure yourself from such sad interruptions and to install everything quickly and smoothly you should do the following:

Before beginning installation of some Drupal distribution open install.php file in your text editor and at the beginning (after ) add these two strings:

set_time_limit(0);
ini_set('memory_limit', '256M');

and save your file. By adding these two strings we disabled php execution time limit and ensured that our script will get 256 Megabytes of RAM, of course, we could set it as 128M, but 256M is more reliable, no one knows how much resources would your distribution require during the installation. Note: these settings are for the installation process only, not for your system!

After saving your changes you can freely go and enjoy the installation process. When you finished, don't forget to delete 'install.php' file for security reasons. Hope this small lifehack will save your nerves.

Comments

Required for comment verification



John Thomas

To throw out another solution, perhaps the key here is batch SQL statements. A single module install isn't a big issue, but installing all the base modules will almost inevitably be resource intensive, but it will also almost inevitably amount to the same or similar results (what I mean is there are relatively few options you can make in the installation process so a newly installed drupal installation looks pretty much the same anywhere)

Reply · 6 years, 9 months ago
Tom Tran

Thanks Tim, I installed managing news locally and it won't work as simple as I thought, then I added the two linese above and voila, saving tons of time. Great share and thanks

Reply · 6 years, 9 months ago
Shawn Price

Nice hack. I don't think this is needed for Open Atrium which leverages Batch API in hook_profile_tasks().

Reply · 6 years, 9 months ago
Cameron Eagans

You could also just set those values in your php.ini - if it's a development box, it shouldn't matter.

Reply · 6 years, 9 months ago
Andrey

If php in cgi mode, this line not work ;)

Reply · 6 years, 9 months ago