5
votes

I am trying to get Zend Framework's quickstart tutorial up and running, but i ran into .htaccess issue. It seems if i remove the .htaccess file, the project runs fine, but if i leave it in there it throws a 403 Forbidden. The .htaccess is the default file generated by Zend Framework console command. Here is the .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

This is under Mac OS X 10.6.5

mod_rewrite is on AllowOveride All

Here is my virtual host info

<VirtualHost *:80>
     ServerName zf_cms.local
     DocumentRoot /Users/kjye/Sites/zf_cms/public
     SetEnv APPLICATION_ENV "development"
     <Directory /Users/kjye/Sites/zf_cms/public>
          Options +Indexes +FollowSymLinks +ExecCGI
          DirectoryIndex index.php
          AllowOverride All
          Order allow,deny
          Allow from all
     </Directory>
</VirtualHost>

I fixed it by adding "Options +Indexes +FollowSymLinks +ExecCGI" Thanks for viewing.

2
Is mod_rewrite enabled and AllowOverride on (at least) FileInfo for the directory?KingCrunch
I fixed it!!! I added "Options +Indexes +FollowSymLinks +ExecCGI" into <Directory>KJYe.Name 葉家仁
I don't think that fixed it, I think you just forgot to restart after changing the default 'Order allow,deny' settings ;) Also, since you have access to your apache configuration it's more efficient to put the rewrite rules right inside your <directory>.. settings and not use the .htaccess file.Darryl E. Clarke
i tried it again by removing Options _Indexes +FollowSymLinks +ExecCGI and got the 403 forbidden ... once insert it back into the httpd-vhosts.conf ... it works again. It has got to be it.KJYe.Name 葉家仁
Very strange - but if it works it works!Darryl E. Clarke

2 Answers

7
votes
<VirtualHost *:80>
 ServerName zf_cms.local
 DocumentRoot /Users/kjye/Sites/zf_cms/public
 SetEnv APPLICATION_ENV "development"
 <Directory /Users/kjye/Sites/zf_cms/public>
      Options +Indexes +FollowSymLinks +ExecCGI
      DirectoryIndex index.php
      AllowOverride All
      Order allow,deny
      Allow from all
 </Directory>

This turns out to work under mac os. thanks for all the help and comment.

2
votes

I was having the same issue and added

Options +Indexes +FollowSymLinks +ExecCGI

Can someone shed some clarity on what the actual problem is and what this does to rectify it?