W
W
wolverine7772019-06-05 11:44:24
linux
wolverine777, 2019-06-05 11:44:24

Apache page does not see PHP - why is this happening?

Hello, I have an index.php page in /home/username/public_html.
In the page, this is a mega-primitive:

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

When I visit this page at http://192.168.56.101/~username/
HTML text is visible without problems, PHP text is not visible!
I understand that in this case Apache cannot read the PHP code...
PHP is installed! 5cf7810ca5741668314538.png
Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
ky0, 2019-06-05
@ky0

You need not just a PHP package, but the corresponding Apache module -libapache2-mod-php

V
Victor Taran, 2019-06-05
@shambler81

is it installed and apache was told to interpret PHP or should he figure it out himself?

T
TyzhSysAdmin, 2019-06-05
@POS_troi

1. They don’t do it like that
2. You have to break your hands for this
3. They don’t do it like that
4. Enable processing html like php

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

But before that, carefully read paragraph 2 :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question