On ubuntu, apache can only display the source code when parsing php
When accessing http://localhost/, it shows that it works!
Then I wrote a phpinfo.php and placed it in /var/www/html. The code is:
<?php
echo phpinfo();
?>
Then I tried to access it
Then I tried to modify the php configuration file, but I couldn't find this file. There was only one conf.d file under /etc/php/7.0/apache2/, and there was no php.ini file in it, so I just Even more puzzled.
Finally I changed the code of phpinfo.php:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
echo phpinfo();
?>
</body>
</html>
At this time, what is parsed is a blank page
So, how can we solve the problem of parsing php like this and only displaying the source code?
$$ a2dismod mpm_event && a2enmod mpm_prefork && a2enmod php7.0