Answer the question
In order to leave comments, you need to log in
Why does Apache emit php code when DocumentRoot changes?
There is a folder with the site /var/www/user/data/www/site.ru
Filled near /var/www/user/data/www/site.ru.v2 and I want to set Apache on it.
I change the DocumentRoot in the config (I add .../site.ru.v2/public), I
restart Apache and it gives out the php code as it is.
What can be wrong? If DocumentRoot is returned to .../site.ru, then php is processed quite correctly.
Answer the question
In order to leave comments, you need to log in
Code /etc/apache2/vhosts/user/site.ru
<VirtualHost 127.0.0.1:8080>
ServerName site.ru
AddDefaultCharset UTF-8
AssignUserID user user
DocumentRoot /var/www/user/data/www/site.ru
ServerAdmin adminSite.ru
ServerAlias www.site.ru
<FilesMatch "\.ph(p[3-5]?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f adminSite.ru"
php_admin_value upload_tmp_dir "/var/www/user/data/mod-tmp"
php_admin_value session.save_path "/var/www/user/data/mod-tmp"
php_admin_value open_basedir "/var/www/user/data:."
CustomLog /var/www/httpd-logs/site.ru.access.log combined
ErrorLog /var/www/httpd-logs/site.ru.error.log
</VirtualHost>
<Directory /var/www/site/data/www/site.ru>
php_admin_flag engine on
Options -ExecCGI
</Directory>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question