0

I have a working Drupal 7 site, built with git, running on 2 different servers, one test server and one server used for staging and production sites. So I know that the site is working.

So after deciding to move the production and staging sites to a new Apache server I cloned my git repo with the whole codebase, to the webroot and created the database and imported a copy of the mysql database.

I then edited the settings.php file to match the new database name, user and password. Using SSH and Cygwin I can login and run mysql commands, like 'show databases' etc. So I know that the mysql connection works too.

But when I try to test the site from a browser I just get a white screen, that times out after a couple of minutes.

I have read this artcile How to see the error messages when I get the white screen of death?, and I have added the suggested lines in order to show error messages in both index.php and settings.php with no change whatsoever. Just a white screen and the busy icon turning.

So maybe there is something in .htaccess that needs to be changed? I tried to uncomment the rewritebase line and adding the site name, with no luck.

  RewriteBase /

The phpinfo.php file in the webroot opens without problems. So I guess it must be somehting odd with the site all the same.

The file structure on the web server does not include any public_html folder. This is how it looks and I have cloned my site directly into this folder:

/home/httpd/example/www.example.com

Is that the problem here? That Drupal 7 needs a another folder structure?

This is what the server error log looks like, after the timeout:

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in /home/httpd/example/www.example.se/includes/bootstrap.inc on line 966

After increasing the memory_limit from 128 MB to 512 MB, the apache server's error message stops complaining about the memory and instead shows this message:

Script timed out before returning headers: index.php

I now tried to do a fresh install of a Drupal 7 site with a new database, which actually worked. I then changed the database settings in settings.php to call my original site database. And that worked to.

So now my code is on speaking terms with the right database. But I have no git branches and all my images an so forth in the default/files folder is missing. But why did this work? Is there a step when deploying a Drupal site to a brand new server with git, that I missed? The git repo contains everything that is needed, but still it didn't work. Please help, if anyone recognizes this behavior.

  • What is the php memory in your development server and production server? In most cases it happens due to loads of content. Have you disabled devel module and other modules that are not required in production website? If possible increase php memory. – sarathkm Nov 7 '16 at 13:03
  • I'd take a look at my memory size by looking at the phpinfo() . And try changing the memory limit to 512 if its under. You can often do this in the servers control panel . or in settings. If php_value memory_limit = "512M" – Deejay Nov 7 '16 at 13:06
  • The set memory_limit is 128 MB in the PHP config. And yes, I have disabled unused modules. And also, the site works perfectly fine in 3 other instances. – TBJ Nov 7 '16 at 13:07
  • Deejay: Thanks, I have now asked the server support to increase the limit. I hope that's it... – TBJ Nov 7 '16 at 13:13
  • sarathkm and Deeyaj: No that was not it. The menory_limit is now increased to 512 MB, with no change. Just white screens. – TBJ Nov 7 '16 at 13:29
0

In case anyone else is struggling with the same problem, here is how I could partially solve it and open the site without the white screen.

In the settings.php file I commented out this line:

// $conf['memcache_servers'] = array('localhost:11211' => 'default');

So if you are using Memcache and are moving to a new environment, try the above if you encounter a white screen problem.

  • Or just disable the memcache module :) – Beebee Nov 8 '16 at 14:16
  • BeeBee: Memcache works fine even without this line and speed things up considerably. I have checked the statistics. So I will rather keep it :-). – TBJ Nov 8 '16 at 14:41
  • I assumed you didn't have memcached on your new server, and commenting out that line disables the integration. But no, it just makes it fallback to the default which is 127.0.0.1:11211. So perhaps there's some configuration differences for memcached, between your new server and the existing one (working). Anyway, nevermind ;) – Beebee Nov 8 '16 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.