如何在子域中运行wordpress php文件?


How can I run wordpress php files in a subdomain?

我正在尝试在子域中安装wordpress 3.9.1,我知道它可以工作,因为我在使用XAMPP的localhost中有相同的版本。子域正在工作(我用html和php文件测试了它),但没有wordpress文件正在运行,我只得到空白页面(不是错误,只是空白页面)。创建了数据库,编辑了wp-config.php并授予了特权,但我仍然无法使wordpress文件运行。这是我的配置:

OS: CentOS 6.5供应商:Digital OceanPHP: 5.3.3Apache: 2.2.15

我的VirtualHost是这样的:

<VirtualHost *:80>
  ServerName blog.domain.com
  DocumentRoot /var/www/blog/
  <Directory "/var/www/blog/">
    Options Indexes FollowSymlinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

根据需要配置wordpress子域:

配置虚拟主机,例如

<VirtualHost *:80>
ServerAdmin you@domain.com
DocumentRoot "/var/www/blog/"
ServerName blog.domain.com
ErrorLog "/var/log/blog.domain.com-error_log"
CustomLog "/var/log/blog.domain.com-access_log" common
<Directory "/var/www/blog/">
    Options +Includes
    AllowOverride all
</Directory>

2)配置wordpress使用子域:

将以下代码行放在文件wp-config.php

的末尾
define('WP_HOME', 'http://blog.domain.com');
define('WP_SITEURL', 'http://blog.domain.com');