Answer the question
In order to leave comments, you need to log in
Debian Jessie + Apache2 + PHP5. Why doesn't PHP work on built sites?
Hello. This is not the first time I set up LAMP on Linux, but this is the first time I have encountered such a problem.
Delivered LAMP and adjusted. Began to check. To check, Apache inserted phpinfo() into the default page. The bottom of the page has become similar to the official site, which symbolizes that. that PHP5 is wound up.
Next, I created my own folder /home/user/public_html and uploaded sites there. In order for the new folder to be visible, I added the following lines to /etc/apache2/apache2.conf :
<Directory /home/user/public_html/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<VirtualHost *:80>
ServerName site.localhost
ServerAdmin [email protected]
DocumentRoot /home/user/public_html/site.localhost
<Directory "/home/user/public_html/site.localhost">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/site-error.log
CustomLog ${APACHE_LOG_DIR}/site-access.log combined
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Well, I asked myself, I'll answer myself. PHP is blocked in configs.
File /etc/apache2/mods-available/php5.conf . You need to comment out the lines:
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_flag engine Off
</Directory>
</IfModule>
# <IfModule mod_userdir.c>
# <Directory /home/*/public_html>
# php_admin_flag engine Off
# </Directory>
# </IfModule>
And all the sites for good should be run on behalf of a specific user of the system, and they should be stored in / var / www, because on servers / home usually has a near-zero size and is rarely backed up / viewed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question