简体   繁体   English

在我的本地Web服务器上迁移了旧的WP博客后,我得到白屏,为什么? wp_options DB表有问题吗?

[英]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. 我是WP的新手(我来自Joomla),并且在本地Web服务器上迁移旧的WP网站(由WP 3.5创建)时发现了一些困难。

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. 我已将网站备份放入Ubuntu本地系统上我的Apache www目录中名为blog的目录中。

  2. Then I have put the database backup on my MySql local server 然后我将数据库备份放在MySql本地服务器上

  3. Finally I have change the values in the wp-config.php file to use my local DB 最后,我将wp-config.php文件中的值更改为使用本地数据库

The problem is that when I try to open the URL: 问题是当我尝试打开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: wp-config.php中,我已通过以下代码激活了调试模式:

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: 在Apache错误日志文件( /var/log/apache2/error.log )内,我发现发生以下错误:

[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: 在线阅读在我看来,我还必须将homesiteurl字段的值更改为wp_options数据库表(它们包含对旧服务器上站点的引用),因此我使用以下值进行了更改:

  • home : http://localhost/blog 主页http://localhost/blog

  • siteurl : http://localhost/blog siteurlhttp://localhost/blog

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? 或者,也许我还在博客目录中创建了一个特定的.htacces文件? (now I have no .htaccess file) (现在我没有.htaccess文件)

Do you have some idea about how to solve this problem? 您是否有解决此问题的想法?

EDIT: 编辑:

The user of my apache2-setup is : 我的apache2-setup的用户是

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: ls -lha / var / www / blog /的结果是:

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: 更新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 andrea @ andrea-virtual-machine:〜$ tail /var/log/apache2/error.log [2014年1月11日星期六12:03:35] [通知]抓住了SIGTERM,关闭了[2014年1月11日星期六12:04:22 ] [注意]已配置Suhosin-Patch的Apache / 2.2.22(Ubuntu)PHP / 5.3.10-1ubuntu3.9-恢复正常运行[2014年1月11日星期六] [错误] [客户端127.0.0.1 ] PHP警告:require_once(/var/www/blog/wp-load.php):无法打开流:/var/www/blog/wp-blog-header.php中第12行没有这样的文件或目录[Sat 2014年1月11日12:20:39] [错误] [客户端127.0.0.1] PHP致命错误:require_once():无法打开所需的'/var/www/blog/wp-load.php'(include_path ='。:/第12行[Sat Jan 11 12:20:39 2014]上/var/www/blog/wp-blog-header.php中的usr / share / php:/ usr / share / pear')[错误] [客户端127.0。 0.1]文件不存在:/var/www/favicon.ico [Sat Jan 11 12:20:39 2014] [错误] [客户端127.0.0.1]文件不存在:/var/www/favicon.ico [Sat 2014年1月11日12:20:46] [错误] [客户端127.0.0.1] PHP警告: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 -load.php):无法打开流:/var/www/blog/wp-blog-header.php中第12行上没有此类文件或目录[2014年1月11日星期六12:20:46] [错误] [客户端127.0.0.1] PHP致命错误:require_once():无法打开所需的'/var/www/blog/wp-load.php'(include_path ='。:/ usr / share / php:/ usr / share / pear')在第12行的/var/www/blog/wp-blog-header.php中[2014年1月11日星期六12:27:38] [错误] [客户端127.0.0.1] PHP警告:require_once(/ var / www / blog / wp-load.php):无法打开流:/var/www/blog/wp-blog-header.php在第12行上没有这样的文件或目录[Sat Jan 11 12:27:38 2014] [错误] [客户端127.0.0.1] PHP致命错误:require_once():无法打开所需的'/var/www/blog/wp-load.php'(include_path ='。:/ usr / share / php:/ usr / share / pear' )在第12行的/var/www/blog/wp-blog-header.php中

Tnx 特纳克斯

Andrea 安德里亚

PHP tries to open the files, as mentioned in your error.log. 如您的error.log中所述,PHP尝试打开文件。 But apache2 has not the sufficient rights to do this. 但是apache2没有足够的权限执行此操作。

This is a server side problem. 这是服务器端的问题。 In addition, changing your home and siteurl -settings will not fix your problem. 另外,更改您的homesiteurl设置不会解决您的问题。

In your case, I think you've uploaded the files with a different user than your web server is running. 就您而言,我认为您使用与运行Web服务器不同的用户上传了文件。 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. 我认为您具有root用户访问权限(因为您可以读取apache2 error.log文件),请检查Web服务器的用户(apache2)和文件的所有者。

Answer: If your webserver is running as www-data your files should be owned by www-data . 答案:如果您的网络服务器以www-data的身份运行,则文件应归www-data拥有。 Check with ps aux | grep apache2 ps aux | grep apache2检查ps aux | grep apache2 ps aux | grep apache2 the user of your apache2-setup and with ls -lha /var/www/blog/ the owner of your files. ps aux | grep apache2是apache2-setup的用户,并具有ls -lha /var/www/blog/文件的所有者。 You should know chown because you have root access ;) 您应该知道chown因为您具有root访问权限;)

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. 如您所说,这只是您可以运行的测试机sudo chown -R www-data:www-data /var/www/blog/ ,错误消息应该消失了。 Fix your permissions with chmod -R 750 /var/www/blog/ to avoid, "world" can read/modify your files. 使用chmod -R 750 /var/www/blog/修复您的权限,以避免“ world”可以读取/修改文件。 I think, php suhosin will deny access to these files using include/require(_once) because of security reasons. 我认为,出于安全原因,php suhosin将使用include / require(_once)拒绝访问这些文件。

Update 2: 更新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. Wordpress缺少/var/www/blog/目录中不存在的文件/var/www/blog/wp-load.php 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. 将来,您应该考虑为不同的(Web)服务创建不同的用户。 Apache2 (or nginx/lighttpd/....) could run as a proxy, and with fcgi or something you run your servers (for php I use php-fpm). Apache2(或nginx / lighttpd / ....)可以作为代理运行,并且可以通过fcgi或其他方式运行服务器(对于php,我使用php-fpm)。 But this is an other question ;) 但这是另一个问题;)

For some reason, the newer versions of Apache expect site configuration files to have a .conf extension. 由于某些原因,Apache的较新版本期望站点配置文件具有.conf扩展名。 After I upgraded my apache, I had the same issue and finally fixed it by re-doing the static links, this time with .conf. 升级Apache之后,我遇到了同样的问题,最后通过重新做静态链接(这次是.conf)来解决了这个问题。

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

should be

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM