S
S
Sergey Burduzha2018-07-17 14:31:23
PHP
Sergey Burduzha, 2018-07-17 14:31:23

Why is php not working in ubuntu?

Installed apache, php using this link Installing Lamp
First, I installed apache2, added chrome localhost in the address bar and the picture appeared as in the manual.
Next, I created a test.site folder, as well as on the site, and installed php.
php -v outputs

PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

Only now the code from the test.php file is output as code and not as a function. Tell me what I forgot or did wrong. I would like any information. <?php phpinfo() ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Popov, 2018-07-17
@serii81

sudo apt-get update
sudo apt-get install libapache2-mod-php7.0
sudo a2enmod php7.0
sudo service apache2 restart
Try to do it like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question