Instead, instead of the file, the php 7 file is loaded instead

I recently configured php7 on Ubuntu 14.04, following the blog http://www.zimuel.it/install-php-7, and successfully installed it according to the blog. but when you try to run the php file (/var/www/test.php) it loads instead of executing. I have no idea what configuration I missed. and when I entered localhost in the browser, it comes up with the answer "it works."

+5
source share
5 answers

You need to enable PHP under Apache, for example:

sudo a2dismod php5

sudo service apache2 restart

sudo cp / etc / apache2 / mods-available / php5.conf / etc / apache 2 / mods-enabled / php7.conf

sudo service apache2 restart

: http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu

0

(Edit) , , Apache . , , 80. , . , , .

LoadModule php7_module        modules/libphp7.so
AddHandler php7-script .php
AddType application/x-httpd-php-source .phps
AddHandler application/x-httpd-php .phps
AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php
0

Ubuntu 18.04. , .

1: , php7 /etc/apache2/mods-available. , php7.conf php7.load 3, .

2. php7 apache. php7.2, , sudo apt-get install libapache2-mod-php7.2. php , .

3: apache. sudo a2enmod php7.2 .

4: Apache, sudo service apache2 restart.

0

CentOS 7 php 7.2 php 5.6 PHP , !

0

apache /etc/apache2/sites-available :

#RemoveHandler .php
#RemoveHandler .php7.0
#php_admin_value engine Off
0

Source: https://habr.com/ru/post/1619654/


All Articles