Apache 500直接从工作服务器复制.htaccess文件时出现内部服务器错误
我得到一个内部服务器错误,我认为一切都设置正确,我把整个网站从我的旧主机到一个新主机,现在我得到的错误。与此相同的.htaccess文件Apache 500直接从工作服务器复制.htaccess文件时出现内部服务器错误,apache,error-handling,Apache,Error Handling,我得到一个内部服务器错误,我认为一切都设置正确,我把整个网站从我的旧主机到一个新主机,现在我得到的错误。与此相同的.htaccess文件 # Mod Rewrite Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] ##
# 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 for 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使用fastcgi/mod\u fcgid时,不能设置
php\u值
尝试对这些值进行注释,或者像这样将它们封装起来
<IfModule mod_php5.c>
php_value something_something 164M
</IfModule>
php_值1.64亿美元
我的主机升级服务器时遇到了同样的问题。将它们从.htaccess中删除后,我将php\u value
语句放入php中;我认为有不止一种方法可以重新实现它们。)我已经尝试了好几天了。与最初的问题一样,我的Apache错误日志也报告了“无效命令'php_value',可能拼写错误或由服务器配置中未包含的模块定义”
最后,看到评论“当apache使用fastcgi/mod_fcgid时,您不能设置php_值”就是一个线索。由于我不知道这意味着什么,但听起来与我的问题有关,我在谷歌上搜索了一下,学到了很多重要的东西:
1) PHP既可以作为Apache模块运行,也可以作为CGI二进制文件运行,这对设置PHP值有很大的影响。要找出哪一个是您的,请运行phpinfo()[如果您不知道如何操作,请用谷歌搜索它]。如果输出显示“php fpm”,那么您的是作为CGI而不是Apache模块运行的
2) 如果您的是作为CGI运行的,那么您不能将php_值或任何其他php设置放在.htaccess中。必须在php.ini(其位置也在phpinfo输出中给出)或通过函数ini_set在php代码中设置它们。比如说
ini_set('display_errors', '1');
3) 最重要的是:如果您更改php.ini,然后重新启动Apache,发现您的设置没有更改,这可能意味着您正在以CGI而不是Apache模块的形式运行。重新启动Apache不会重新加载php.ini是有道理的,因为它没有运行php。要进行更改,必须重新启动php fpm服务!(几天来我一直在发愁,因为我能找到的关于在php.ini中设置值的每一个答案都说你更改了php.ini并重新启动了Apache,这很有效。但它对我不起作用。这就是为什么。)在我正在构建的系统上,在Amazon AWS Linux 2实例上,重新启动服务的命令是:
sudo systemctl restart php-fpm
你的可能不一样
我希望这个答案能帮助一些像我一样沮丧的人
Frank如果你有500,请查看你的Apache错误日志。错误将在那里报告。我做的是,文件夹(2)中的错误日志都是空白的,上面没有任何内容,apache日志只是说。。。89.145.108.207---[09/Oct/2012:18:50:13-0700]“获取www.cristinadunlap.com/index.php HTTP/1.1”302-““Mozilla/4.0(兼容;MSIE 7.0;Windows NT 5.1;.NET CLR 1.1.4322;.NET CLR 2.0.50727;.NET CLR 3.0.4506.2152;.NET CLR 3.5.30729;InfoPath.2;MS-RTC LM 8)”检查重写模块(mod\u rewrite.so>)是在apache的配置中启用的。我不相信我有权访问它,因为客户端要求将该站点放在godaddy上