Zend Framework - 500 Internal Server Error

Today I am creating my first project with the Zend Framework, but when I try to connect to my project, I see only "500 Internal Server Error". I am adding a few new lines to the 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 this 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 so far the problem has not been resolved.

This 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 
+7
source share
3 answers

Thanks for posting the error log.

In appearance, you do not have loaded mod_rewrite .

Locate the httpd.conf file and find the line:

 #LoadModule rewrite_module modules/mod_rewrite.so 

Remove the # sign from the beginning of the line.

Then 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 not processed if allowed. This line allows .htaccess files in the specified directory.

After making these changes, restart Apache, and then try loading the ZF page again.

+16
source

First of all, the best debugging. Add

  ErrorLog "PATH_TO/zfapp-error_log" CustomLog "PATH_TP/zfapp-access_log" combined 

to your virtual host. Restart apache and reload the page. Files are created at the specified path. There will be an exact error message that will help you debug further.

+3
source

I had exactly the same problem and a solution from drew010 really fixed it!

However, it looks like the Apache configuration structure has changed, so the method for including the missing module is slightly different:

 $ cd /etc/apache2/mods-enabled $ sudo ln -s ../mods-available/rewrite.load ./rewrite.load 

This confirms that you have the right things:

 $ cd /etc/apache2/mods-enabled $ cat ./rewrite.load LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so 

Hooray!

0
source

All Articles