Answer the question
In order to leave comments, you need to log in
How to set virtual hosts to the correct directory in php7?
Hello.
Initially installed on CentOS 7 LAMP with php 5.4
Configured my virtual host in /etc/httpd/conf.d/site.ru.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName site.ru
ServerAlias www.site.ru
DocumentRoot /var/www/site.ru/
ErrorLog /var/www/site.ru/logs/error.log
CustomLog /var/www/site.ru/logs/access.log combined
</VirtualHost>
ServerRoot "/etc/httpd"
Listen 127.0.0.1:80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin [email protected]
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%V %a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLogFormat "%V [%t] [%l] [pid %P] %F: %E: [client %a] %M"
<IfModule logio_module>
LogFormat "%V %a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
Include conf.d/*.conf
RemoteIPHeader LOCAL-X-Real-IP
Answer the question
In order to leave comments, you need to log in
The question was asked incorrectly. The php version has nothing to do with apache routing. To help you, you need to see the entire web server config.
1. Look in /etc/httpd .conf for a file that might have installed php.
2. Look who hangs on ports 80 and 443 - netstat -pna
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question