Page Apache sees PHP — why is this happening?

Hi, I have in /home/username/public_html is the page index.php

In the page that is now megaprimatus:

<html>
HTML text
<?php
echo "PHP text";
?>
</html>


When I go to the page http://http://192.168.56.101/~username/
HTML text - it is visible without problems, PHP text is not visible!

I understand that in this case Apache can't read PHP code...

PHP installed! 5cf7810ca5741668314538.png

Thank you!
March 23rd 20 at 19:10
3 answers
March 23rd 20 at 19:12
it is installed and Apache announced that you need to interpret PHP or he have to guess?
March 23rd 20 at 19:14
You don't just need the PHP package and the corresponding Apache module - libapache2-mod-php
Thanks
5cf7985921227785600587.png

Apache restarted but still can't see... - chaya_Rippin commented on March 23rd 20 at 19:17
March 23rd 20 at 19:16
1. Don't do that
2. For this you need your hands to break
3. Don't do that
4. To include processing html as php
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

But before that vnimatelno to read Chapter 2 :)
For what hands to break?

I have /home/username/public_html is the page index.php


For failing to read the question before you answer, unless... - Eryn_Rowe commented on March 23rd 20 at 19:19
@Eryn_Rowe, wringing your hands for mixing in a single file logic and display. - helmer commented on March 23rd 20 at 19:22
@helmer, in the test file of the five rows, which checks the basic operability? :-) - Eryn_Rowe commented on March 23rd 20 at 19:25
@Eryn_Rowe, Yes, first they write a test file and then wordpress start to write :) - helmer commented on March 23rd 20 at 19:28
Well Hello again everyone. Here is the solution to the problem (from a friend of Yandex ))))) )

Here is: cat /etc/apache2/mods-enabled/php7.0.conf

I should have just thecommunity the last paragraph (as it says comment the following lines # (from to .))
# Running PHP scripts in user directories is disabled by default
#
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
#<IfModule mod_userdir.c>
# <Directory /home/*/public_html>
# php_admin_flag engine Off
# </Directory>
#</IfModule>


and all - chaya_Rippin commented on March 23rd 20 at 19:31

Find more questions by tags DebianApacheLinux