php – Zend Framework – 500内部服务器错误
发布时间:2020-12-13 18:19:02 所属栏目:PHP教程 来源:网络整理
导读:今天我用Zend Framework创建了我的第一个项目但是当我尝试连接到我的项目时,我只看到“500内部服务器错误”.我在httpd.conf文件中添加了一些新行: NameVirtualHost *:80VirtualHost *:80DocumentRoot C:AppServwwwdata1publicServerName my_ip/VirtualH
今天我用Zend Framework创建了我的第一个项目但是当我尝试连接到我的项目时,我只看到“500内部服务器错误”.我在httpd.conf文件中添加了一些新行:
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot C:AppServwwwdata1public ServerName my_ip </VirtualHost> NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot C:AppServwwwdata1public ServerName http://my_ip </VirtualHost> 那是我的htaccess文件: 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 我为这个问题阅读了更多主题,但目前问题尚未解决. 那是我的error.log文件(来自服务器): [Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServphp5 extphp_exif.dll' - xd3xeaxe0xe7xe0xedxe0xf2xe0 xefxf0xeexf6xe5xe4 xf3xf0xe0 xedxe5 xe5 xedxe0xecxe5xf0xe5xedxe0.rn 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:/AppServphp5extphp_exif.dll' - xd3xeaxe0xe7xe0xedxe0xf2xe0 xefxf0xeexf6xe5xe4xf3xf0xe0 xedxe5 xe5 xedxe0xecxe5xf0xe5xedxe0.rn 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
感谢您发布错误日志.
从它的外观来看,你没有加载mod_rewrite. 找到您的httpd.conf文件并找到该行: #LoadModule rewrite_module modules/mod_rewrite.so 从行的开头删除#符号. 接下来,向httpd.conf添加一个新的部分,如下所示: <Directory "C:/AppServ/www/data1/public"> Options FollowSymLinks AllowOverride All </Directory> AllowOverride指令很重要.默认情况下,除非允许,否则不处理.htaccess文件.此行允许该命名目录中的.htaccess文件. 进行这些更改后,重新启动Apache,然后再次尝试加载ZF页面. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |