与.htaccess文件500内部服务器错误从工作服务器直接复制

问题描述 投票:1回答:2

我得到一个内部服务器错误,我觉得一切都设置正确,我把整个网站从我的旧主机到一个新的主机,现在我得到的错误。同样的.htaccess文件看起来像这样

 # Mod Rewrite
 Options +FollowSymLinks
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]

 ## adjust memory limit

 # php_value memory_limit 64M 
 php_value memory_limit 256M 
 php_value max_execution_time 18000

不知道是什么的问题是,任何帮助表示赞赏

注意,该网站现在托管在GoDaddy的,我被告知,我需要以下行添加到htaccess的为modrewrite

#Fix Rewrite
Options -Multiviews

还是行不通

好了,终于拿到了这个错误报告,

[Wed Oct 10 15:05:09 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhapsmisspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:05:10 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:06:07 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:06:07 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:06:51 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:06:51 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:07:10 2012] [warn] [client 64.60.65.18] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 10 15:07:10 2012] [error] [client 64.60.65.18] Premature end of script headers: index.php
[Wed Oct 10 15:07:10 2012] [warn] [client 64.60.65.18] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 10 15:07:10 2012] [error] [client 64.60.65.18] Premature end of script headers: index.php
[Wed Oct 10 15:07:12 2012] [warn] [client 64.60.65.18] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 10 15:07:12 2012] [error] [client 64.60.65.18] Premature end of script headers: index.php
[Wed Oct 10 15:07:12 2012] [warn] [client 64.60.65.18] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 10 15:07:12 2012] [error] [client 64.60.65.18] Premature end of script headers: index.php
[Wed Oct 10 15:07:13 2012] [warn] [client 64.60.65.18] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 10 15:07:13 2012] [error] [client 64.60.65.18] Premature end of script headers: index.php
[Wed Oct 10 15:07:13 2012] [warn] [client 64.60.65.18] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 10 15:07:13 2012] [error] [client 64.60.65.18] Premature end of script headers: index.php
[Wed Oct 10 15:07:18 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Wed Oct 10 15:07:18 2012] [alert] [client 64.60.65.18] /var/chroot/home/content/23/9953123/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
apache error-handling
2个回答
2
投票

当Apache正在使用FastCGI / mod_fcgid您不能设置php_value

尝试注释掉那些值,或包住他们像

<IfModule mod_php5.c>
   php_value something_something  164M
</IfModule>

我只是碰到了同样的问题时,我的主机升级的服务器。从的.htaccess取出之后,我把我的php_value语句到PHP;我认为有重新实现它们的方法不止一种。)


0
投票

我一直在试图算出这个数天。像原来的问题表明,我的Apache的错误日志也报告“无效的命令‘php_value’,也许不包括在服务器配置的模块拼写错误或定义”

最后,整个评论未来是一个线索:“你不能当Apache正在使用FastCGI / mod_fcgid设置php_value”。因为我不知道这意味着什么,但它听起来有关我的问题,我用Google搜索周围,也学到了很多重要的东西:

1)PHP可以运行作为Apache模块或作为CGI二进制和,使得在设置php价值的巨大差异。要找出你的是,运行phpinfo()函数[谷歌,如果你不知道该怎么做。如果输出显示“PHP-fpm的”你然后运行作为CGI而不是作为Apache模块。

2)如果你正在运行的CGI,那么你不能把php_value或在.htaccess任何其他PHP设置。您必须在php.ini(其位置在的phpinfo输出也给出),或者通过功能的ini_set PHP代码设置。例如

ini_set('display_errors', '1');

3)最重要的是:如果你改变php.ini文件,然后重新启动Apache和发现你的设置不会改变,这可能意味着你正在运行的CGI,而不是作为一个Apache模块。这是有道理的,然后因为它没有运行PHP的重启动Apache将不会重新加载的php.ini。为了让改变发生,你必须重新启动的php-fpm的服务! (我一直在拉我的头发了天,因为大约在php.ini中设置值每一个答案,我能找到说你改变php.ini文件并重新启动Apache和那只是工作,但它并没有为我工作。这就是为什么。)在我建立制度,这是在亚马逊AWS的Linux 2例如,要重新启动该服务的命令是:

sudo systemctl restart php-fpm

你可能会有所不同。

我希望这个答案可以帮助一些人谁是为失意就像我一直。

坦率

© www.soinside.com 2019 - 2024. All rights reserved.