apache - PHP code is rendered as text -


i'm using ubuntu 16.04 , want run php files.

i installed php 7 on using:

sudo mkdir -p /var/www/html sudo chown -r $user:$user /var/www/html sudo apt install php sudo apt install apache2 

i created php file (e.g. test.php) in /var/www/html. can access in browser (e.g. http://localhost/test.php). instead of executing <?php ... ?> code, displayed plain text:

i tried turn short_open_tag on. edited /etc/php/7.0/fpm/php.ini , enabled it.

then ran sudo service php7.0-fpm restart. didn't make change in browser. php code still displayed plain text.

how can fix this?

you didn't install apache properly, doing apt-get on apache2 not install everything.

what @newman stated correct can follow guide, or here digitalocean link usuable production server (since on droplet). note full stack lamp, assume when want dab mysql

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -