Search code examples
phpapachesymfony1xamppsymfony-1.4

symfony 1.4.8 conflict with PHP 5.4.7 and Apache 2.4.3


I recently updated my Xampp server (from 1.7 >> 1.8) and since then I'm no longer able to run my projects written in Symfony 1.4.8.

It says:

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

But it has permissions!

Actually it works fine with older version of Xampp. Is it possible that Symfony 1.4.8 is not compatible with Apache 2.4 or PHP 5.4? I'm using Windows 8 Enterprise, but also tested on Windows 7 Ultimate and same problem exists.

Any suggestions would be appreciated.

Here is my config:

NameVirtualHost 127.0.0.1:1111
Listen 127.0.0.1:1111
<VirtualHost 127.0.0.1:1111>
  DocumentRoot "D:\AMir\PROJECTS\BarzinMehr\web"
  DirectoryIndex index.php
  <Directory "D:\AMir\PROJECTS\BarzinMehr\web">
    AllowOverride All
    Allow from All
  </Directory>
  Alias /sf C:\xampp\htdocs\symfony\data\web\sf
  <Directory "C:\xampp\htdocs\symfony\data\web\sf">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

And here is my .htaccess

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

Solution

  • after struggling with this problem for so many days, i finally found the solution and i'm taking it here in favour of anyone else who might face this problem. according to this article (thanks to the writer!) all i had to do was this:

    change each Directory block like this:

    <Directory "your address">
        AllowOverride All
        Allow from All
    </Directory>
    

    to

    <Directory "your address">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Require all granted
    </Directory>  
    

    it seems that Allow was dropped in favor of new directive Require in apache 2.4(according to documentation for version apache 2.4)