M
M
Mark Kalerin2016-12-04 18:11:07
symfony
Mark Kalerin, 2016-12-04 18:11:07

What is the error in Apache config for Symfony?

Tell me, what could be the problem: I'm trying to set up an Apache config for a site on symfony, as a result, instead of the head of the page, the code is simply output. Config:

<VirtualHost *:80>
ServerName accesses.site.ru
  ServerAlias www.accesses.site.ru
  DocumentRoot /var/www/www-root/data/www/accesses.site.ru/web
    ServerAdmin [email protected]
  DirectoryIndex index.html index.php
  AddDefaultCharset off
  AssignUserID www-root www-root
    <Directory /var/www/www-root/data/www/accesses.site.ru/web>
    Require all granted
        AllowOverride All
        Order Allow,Deny
        Allow from All
        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app.php [QSA,L]
        </IfModule>
    </Directory>

    # uncomment the following lines if you install assets as symlinks
    # or run into problems when compiling LESS/Sass/CoffeeScript assets
    <Directory /var/www/project>
       Options FollowSymlinks
    </Directory>
 <Directory /var/www/www-root/data/www/accesses.site.ru/bundles>
        <IfModule mod_rewrite.c>
            RewriteEngine Off
        </IfModule>
    </Directory>
    CustomLog /var/www/httpd-logs/accesses.site.ru.access.log combined
  ErrorLog /var/www/httpd-logs/accesses.site.ru.error.log
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2016-12-04
@Doromor

It looks more like not a host config error, but not installed php or its module not connected (depending on which environment). Because the web server does what is asked of it - it shows the contents of app.php
. But it does not know that this content needs to be run through the php preprocessor and the result of the script execution returned to the user. Check if php is installed, how it is installed (apache module or php-fpm or whatever), if it is connected at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question