Drupal hangs on installation: cause and workaround

Posted by Elf Sternberg as PHP

One very rare problem that hits some people with Drupal is that it hangs on installation, and never gets anywhere.  Using Firebug, I was able to track the problem down to jQuery, then ripped out the minimized copy of jQuery, stuck in a full copy, and re-ran the install, which immediately revealed the bug.

Drupal was attempting to access a URL that is not sandboxed (in the list of legal URLs for its own site) using Javascript.  Javascript limits (“sandboxes”) URLs to prevent cross-site exploits, and in this case Drupal was attempting to access an IP-based URL on a different port.

There are two interrelated problems.  First, access on the IP rather than the host name.  Firefox can’t tell those are the same address and sandboxes them apart from one another.  Attempting to access one from the other is a security violation.  Second, access on a different port: that was caused by Nginx as a front-end to the Apache box.  Drupal is relying on Apache’s “ServerName” setting, and it shouldn’t.

If you’re having this problem and you’re developing on the same box you’re browsing from,  stop and then restart Apache.  If you see this message: apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName, that’s your problem.  Use the IP address rather than any locally assigned hostnames for the Drupal install.

Secondly, if you’re using Nginx or any other reverse proxy, go around it.  Use the IP address of the Apache install directly, not the reverse proxy’s front end.

I hope this helps someone out there.

4 Responses to Drupal hangs on installation: cause and workaround


October 12th, 2010 at 8:36 am

Thanks for the tips! You got me thinking with the jQuery comment, that perhaps it was an issue with javascript handling. I have many web developer tools on FireFox (latest version), and I tried the same install script on Chrome and it worked! Not necessarily because FF couldn’t do it, but because perhaps Firebug was impacting the running of the javascript. Either way, now I know – if it hangs, drop the database tables and try it from another browser.

Elf Sternberg

October 13th, 2010 at 2:43 pm

It’s not “another browser,” it’s the URL you’re using. Use “” consistently, and you’ll get past the hang-up.


August 27th, 2013 at 8:03 am

We are seeing hanging and an infinite mysql loop of:
create table drupal_install_test
insert into drupal_install_test (id) values(1)
update drupal_install_test set id=2
delete from drupal_install_test
drop table drupal_install_test
select value from varialbe where name=’install_task’
insert into semaphore (name, value, expire) values…
select name, value from variable
delete from semaphore where ….
select name, filename from system where status=1 and bootstrap=1 and type=’module’…
select 1 from blocked_ips where ip= …
and many (thousands of)
select data, item_id from queue where name=’drupal_batch:1:0′ order by….
Thanks for any assistance.


Elf Sternberg

September 2nd, 2013 at 11:51 am


Sorry, man, but it’s been years since I last delved into Drupal. I have no idea where to start.

Comment Form

Subscribe to Feed



July 2009
« Jun   Aug »