Zend框架 - 500内部服务器错误 [英] Zend Framework - 500 Internal Server Error
问题描述
今天我创造我与Zend框架的第一个项目,但是当我尝试连接到我的项目,我只看到500内部服务器错误。我加在httpd.conf文件中的一些新行:
了NameVirtualHost *:80
<虚拟主机*:80>
DocumentRoot文件C:\ AppServ一起\ WWW \ DATA1 \公
服务器名my_ip
< /虚拟主机>
了NameVirtualHost *:80
<虚拟主机*:80>
DocumentRoot文件C:\ AppServ一起\ WWW \ DATA1 \公
服务器名HTTP:// my_ip
< /虚拟主机>
这是我的htaccess文件:
RewriteEngine叙述上
#RewriteBase数据1 /公/
的RewriteCond%{} REQUEST_FILENAME -s [OR]
的RewriteCond%{} REQUEST_FILENAME -l [OR]
的RewriteCond%{} REQUEST_FILENAME -d
。重写规则^ * $ - [NC,L]
重写规则^ * $的index.php [NC,L]
重写规则\!(JS | ICO | GIF | JPG | PNG | CSS |瑞士法郎|全文| PPS)$的index.php [NC,L]
为了允许,拒绝
允许所有
我读到更多的主题这个问题,但现在的问题不就解决了。
这是我的error.log文件(从服务器):
[星期三8月8日1时46分○二秒2012] [提醒]了NameVirtualHost *:80没有VirtualHosts
PHP的警告:PHP启动:无法加载动态库'C:/ AppServ一起\\ \\ PHP5分机\\ php_exif.dll' - \ XD3 \ XEA \ xe0 \ XE7 \ xe0 \固定的\ xe0 \ XF2 \ xe0 \ XEF \ XF0 \ XEE \ XF6 \ xe5 \ XE4 \ XF3 \ XF0 \ xe0 \固定的\ xe5 \ xe5 \固定的\ xe0 \ XEC \ xe5 \ XF0 \ xe5 \固定的\ xe0。\ r \在线0 n个未知
[星期三8月8日一点46分02秒2012] [声明]的Apache / 2.2.8(Win32的)PHP / 5.2.6设置 - 恢复正常运营
[星期三8月8日一点46分02秒2012] [声明] Server内置:二零零八年一月十八日0时37分19秒
[星期三08年8月一点46分02秒2012] [声明]家长:创建子进程2392
[星期三8月8日一点46分02秒2012] [提醒]了NameVirtualHost *:80没有VirtualHosts
[星期三08年8月一点46分02秒2012] [提醒]了NameVirtualHost *:80没有VirtualHosts
PHP的警告:PHP启动:无法加载动态库'C:/ AppServ一起\\ \\ PHP5分机\\ php_exif.dll' - \ XD3 \ XEA \ xe0 \ XE7 \ xe0 \固定的\ xe0 \ XF2 \ xe0 \ XEF \ XF0 \ XEE \ XF6 \ xe5 \ XE4 \ XF3 \ XF0 \ xe0 \固定的\ xe5 \ xe5 \固定的\ xe0 \ XEC \ xe5 \ XF0 \ xe5 \固定的\ xe0。\ r \在线0 n个未知
[星期三08年8月一点46分02秒2012] [声明]儿童2392:儿童进程正在运行
[星期三08年8月一点46分02秒2012] [声明]儿童2392:后天开始互斥。
[星期三8月8日一点46分02秒2012] [声明]儿童2392:64开始工作线程。
[星期三08年8月一点46分02秒2012] [声明]儿童2392:启动线程侦听端口80。
[星期三08年8月1点46分15秒2012] [警惕] [客户46.40.124.225] C:/AppServ/www/data1/public/.htaccess:无效的命令RewriteEngine叙述,也许是拼写错误或定义的模块不包括在服务器配置
感谢张贴错误日志。
从外观上来看,你没有的mod_rewrite
加载。
找到你的的httpd.conf
文件并找到行:
#LoadModule rewrite_module模块/ mod_rewrite.so
从行的开头删除#
标志。
接着,添加一个新的节的httpd.conf
看起来是这样的:
<目录C:/ AppServ一起/网络/数据1 /公众>
有FollowSymLinks
设置AllowOverride所有
< /目录>
在的AllowOverride
指令是很重要的。默认情况下,的.htaccess
文件进行处理,除非允许的。该行允许在指定目录的.htaccess
文件。
进行这些更改后,重新启动Apache,然后尝试再次加载你的ZF页。
Today I create my first project with Zend Framework but when I try to connect to my project I see only "500 Internal Server Error". I add some new rows in httpd.conf file:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:\AppServ\www\data1\public
ServerName my_ip
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:\AppServ\www\data1\public
ServerName http://my_ip
</VirtualHost>
And that is my htaccess file:
RewriteEngine On
#RewriteBase data1/public/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteRule !\.(js|ico|gif|jpg|png|css|swf|html|pps)$ index.php [NC,L]
order allow,deny
allow from all
I read more topics for this problem but for now problem is not solved.
That is my error.log file(from server):
[Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5 \\ext\\php_exif.dll' - \xd3\xea\xe0\xe7\xe0\xed\xe0\xf2\xe0 \xef\xf0\xee\xf6\xe5\xe4 \xf3\xf0\xe0 \xed\xe5 \xe5 \xed\xe0\xec\xe5\xf0\xe5\xed\xe0.\r\n in Unknown on line 0
[Wed Aug 08 01:46:02 2012] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Wed Aug 08 01:46:02 2012] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 08 01:46:02 2012] [notice] Parent: Created child process 2392
[Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_exif.dll' - \xd3\xea\xe0\xe7\xe0\xed\xe0\xf2\xe0 \xef\xf0\xee\xf6\xe5\xe4\xf3\xf0\xe0 \xed\xe5 \xe5 \xed\xe0\xec\xe5\xf0\xe5\xed\xe0.\r\n in Unknown on line 0
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Child process is running
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Acquired the start mutex.
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Starting 64 worker threads.
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Starting thread to listen on port 80.
[Wed Aug 08 01:46:15 2012] [alert] [client 46.40.124.225] C:/AppServ/www/data1/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Thanks for posting the error log.
From the looks of it, you don't have mod_rewrite
loaded.
Find your httpd.conf
file and locate the line:
#LoadModule rewrite_module modules/mod_rewrite.so
Remove the #
sign from the beginning of the line.
Next, add a new section to httpd.conf
that looks like this:
<Directory "C:/AppServ/www/data1/public">
Options FollowSymLinks
AllowOverride All
</Directory>
The AllowOverride
directive is important. By default, .htaccess
files are not processed unless allowed. This line allows .htaccess
files in that named directory.
After making those changes, restart Apache and then try loading your ZF page again.
这篇关于Zend框架 - 500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!