AndreaNobili
AndreaNobili

Reputation: 42957

After migration of an old WP blog on my local web server I obtain white screen, why? is it a wp_options DB table problems?

I am pretty new in WP (I came from Joomla) and I am finding some difficulties in the migration of an old WP website (made inWP 3.5) on my local web server.

I have performed the following operation:

  1. I have put the website backup into a directory named blog into my Apache www directory on my Ubuntu local system.

  2. Then I have put the database backup on my MySql local server

  3. Finally I have change the values in the wp-config.php file to use my local DB

The problem is that when I try to open the URL:

http://localhost/blog/

to see the website I see noting (a white screen)

Inside the wp-config.php I have activated the debug mode by the line:

define('WP_DEBUG', true);

and I have no errors, so I think that this is not a DB problem.

Inside the Apache error log file (/var/log/apache2/error.log) I found that the following errors occurs:

[Fri Jan 10 22:04:50 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.9 with Suhosin-Patch configured -- resuming normal operations
[Fri Jan 10 22:05:08 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:05:08 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:37 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:37 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:38 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:38 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:39 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:39 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:40 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12
[Fri Jan 10 22:38:40 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12

Reading online it seems to me that I also have to change the values of the home and siteurl fields into the wp_options database table (they contained references to the site on the old server), so I have change it with these values:

But the problem persist (I always see a white screen).

I think that maybe the problem could be that these value are wrong, or maybe I have change some other values? Or maybe I also create a specific .htacces file into my blog directory? (now I have no .htaccess file)

Do you have some idea about how to solve this problem?

EDIT:

The user of my apache2-setup is:

andrea@andrea-virtual-machine:~$ ps aux | grep apache2
root      1715  0.0  0.2 193524  8564 ?        Ss   10:31   0:00 /usr/sbin/apache2 -k start
www-data  2241  0.0  1.0 225380 33440 ?        S    10:31   0:01 /usr/sbin/apache2 -k start
www-data  2242  0.1  1.2 236964 41140 ?        S    10:31   0:04 /usr/sbin/apache2 -k start
www-data  2243  0.0  1.3 238908 43456 ?        S    10:31   0:00 /usr/sbin/apache2 -k start
www-data  2244  0.0  1.1 229612 37820 ?        S    10:31   0:00 /usr/sbin/apache2 -k start
www-data  2245  0.0  1.0 229236 33676 ?        S    10:31   0:00 /usr/sbin/apache2 -k start
www-data  3605  0.0  1.0 229276 34016 ?        S    10:49   0:01 /usr/sbin/apache2 -k start
www-data  3704  0.0  1.1 230456 38420 ?        S    10:53   0:02 /usr/sbin/apache2 -k start
www-data  4228  0.0  0.8 224548 28988 ?        S    11:14   0:00 /usr/sbin/apache2 -k start
www-data  4248  0.0  0.8 217752 28824 ?        S    11:15   0:00 /usr/sbin/apache2 -k start
www-data  4249  0.2  1.1 229568 37752 ?        S    11:15   0:02 /usr/sbin/apache2 -k start
andrea    4520  0.0  0.0  13624   936 pts/0    S+   11:37   0:00 grep --color=auto apache2

The result of ls -lha /var/www/blog/ is:

andrea@andrea-virtual-machine:~$ ls -lha /var/www/blog/
totale 268K
drwxrwxrwx 4 andrea andrea 4,0K gen 10 20:59 .
drwxrwxrwx 6 root   root   4,0K gen 11 11:05 ..
-rwxrwxrwx 1 andrea andrea   53 set 17  2012 googleb4cdab7e5166ee07.html
-rwxrwxrwx 1 andrea andrea  395 dic 12  2012 index.php
-rwxrwxrwx 1 andrea andrea  402 set 17  2012 LEGGIMI.txt
-rwxrwxrwx 1 andrea andrea  20K dic 12  2012 license.txt
-rwxrwxrwx 1 andrea andrea  25K set 17  2012 licenza.html
-rwxrwxrwx 1 andrea andrea 9,0K dic 12  2012 readme.html
-rwxrwxrwx 1 andrea andrea 120K dic 10  2012 sitemap.xml
-rwxrwxrwx 1 andrea andrea  17K dic 10  2012 sitemap.xml.gz
-rwxrwxrwx 1 andrea andrea 4,6K dic 12  2012 wp-activate.php
drwxrwxrwx 9 andrea andrea 4,0K gen 11  2014 wp-admin
-rwxrwxrwx 1 andrea andrea 1,4K set 17  2012 wp-app.php
-rwxrwxrwx 1 andrea andrea  226 set 17  2012 wp-atom.php
-rwxrwxrwx 1 andrea andrea  271 dic 12  2012 wp-blog-header.php
-rwxrwxrwx 1 andrea andrea 3,5K dic 12  2012 wp-comments-post.php
-rwxrwxrwx 1 andrea andrea  244 set 17  2012 wp-commentsrss2.php
-rwxrwxrwx 1 andrea andrea 3,5K gen 10 20:59 wp-config.php
-rwxrwxrwx 1 andrea andrea 3,5K gen 10 20:57 wp-config.php~
-rwxrwxrwx 1 andrea andrea 3,2K dic 12  2012 wp-config-sample.php
drwxrwxrwx 6 andrea andrea 4,0K gen 11  2014 wp-content

UPDATE 1:

andrea@andrea-virtual-machine:~$ ls -lha /var/www/blog/
totale 272K
drwxrwxrwx 4 www-data www-data 4,0K gen 11 12:27 .
drwxrwxrwx 6 root     root     4,0K gen 11 11:05 ..
-rwxrwxrwx 1 www-data www-data   53 set 17  2012 googleb4cdab7e5166ee07.html
-rwxrwxrwx 1 www-data www-data  395 dic 12  2012 index.php
-rwxrwxrwx 1 www-data www-data  402 set 17  2012 LEGGIMI.txt
-rwxrwxrwx 1 www-data www-data  20K dic 12  2012 license.txt
-rwxrwxrwx 1 www-data www-data  25K set 17  2012 licenza.html
-rwxrwxrwx 1 www-data www-data 9,0K dic 12  2012 readme.html
-rwxrwxrwx 1 www-data www-data 120K dic 10  2012 sitemap.xml
-rwxrwxrwx 1 www-data www-data  17K dic 10  2012 sitemap.xml.gz
-rwxrwxrwx 1 www-data www-data 4,6K dic 12  2012 wp-activate.php
drwxrwxrwx 9 www-data www-data 4,0K gen 11  2014 wp-admin
-rwxrwxrwx 1 www-data www-data 1,4K set 17  2012 wp-app.php
-rwxrwxrwx 1 www-data www-data  226 set 17  2012 wp-atom.php
-rwxrwxrwx 1 www-data www-data  271 dic 12  2012 wp-blog-header.php
-rwxrwxrwx 1 www-data www-data 3,5K dic 12  2012 wp-comments-post.php
-rwxrwxrwx 1 www-data www-data  244 set 17  2012 wp-commentsrss2.php
-rwxrwxrwx 1 www-data www-data 3,5K gen 10 20:59 wp-config.php
-rwxrwxrwx 1 www-data www-data 3,5K gen 10 20:57 wp-config.php~
-rwxrwxrwx 1 www-data www-data 3,2K gen 11 12:27 wp-config-sample.php
-rwxrwxrwx 1 andrea   andrea   3,2K gen 11 12:27 wp-config-sample.php~
drwxrwxrwx 6 www-data www-data 4,0K gen 11  2014 wp-content
andrea@andrea-virtual-machine:~$ 

andrea@andrea-virtual-machine:~$ tail /var/log/apache2/error.log [Sat Jan 11 12:03:35 2014] [notice] caught SIGTERM, shutting down [Sat Jan 11 12:04:22 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.9 with Suhosin-Patch configured -- resuming normal operations [Sat Jan 11 12:20:39 2014] [error] [client 127.0.0.1] PHP Warning: require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Sat Jan 11 12:20:39 2014] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12 [Sat Jan 11 12:20:39 2014] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico [Sat Jan 11 12:20:39 2014] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico [Sat Jan 11 12:20:46 2014] [error] [client 127.0.0.1] PHP Warning: require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Sat Jan 11 12:20:46 2014] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12 [Sat Jan 11 12:27:38 2014] [error] [client 127.0.0.1] PHP Warning: require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Sat Jan 11 12:27:38 2014] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12

Tnx

Andrea

Upvotes: 0

Views: 1227

Answers (2)

Yusufk
Yusufk

Reputation: 1172

For some reason, the newer versions of Apache expect site configuration files to have a .conf extension. After I upgraded my apache, I had the same issue and finally fixed it by re-doing the static links, this time with .conf.

/etc/apache2/sites-enabled/000-default 

should be

/etc/apache2/sites-enabled/000-default.conf

Upvotes: 0

tjati
tjati

Reputation: 6079

PHP tries to open the files, as mentioned in your error.log. But apache2 has not the sufficient rights to do this.

This is a server side problem. In addition, changing your home and siteurl-settings will not fix your problem.

In your case, I think you've uploaded the files with a different user than your web server is running. I think you have root-access (because you can read your apache2 error.log-file), check the user of your web server (apache2) and the owner of your files.

Answer: If your webserver is running as www-data your files should be owned by www-data. Check with ps aux | grep apache2 the user of your apache2-setup and with ls -lha /var/www/blog/ the owner of your files. You should know chown because you have root access ;)

Update:

Because you said, this is only your test machine you can run: sudo chown -R www-data:www-data /var/www/blog/ and the error messages should be gone. Fix your permissions with chmod -R 750 /var/www/blog/ to avoid, "world" can read/modify your files. I think, php suhosin will deny access to these files using include/require(_once) because of security reasons.

Update 2:

Oh, I re-read your error-log. Wordpress is missing the file /var/www/blog/wp-load.php which does not exists in your /var/www/blog/-directory. So, you should copy these file (and recheck if any other files are missing, too).

Bonus: This may cause security issues, running everthing using the same user. In the future you should think about create different users for your different (web) services. Apache2 (or nginx/lighttpd/....) could run as a proxy, and with fcgi or something you run your servers (for php I use php-fpm). But this is an other question ;)

Upvotes: 0

Related Questions