Installed with a 1-click LAMP on my droplet (2 weeks ago). I now need to create a dynamic page using php, but if a create a file “test.php” with the following code:
<?php echo "Hello!"; ?>
instead of showing me an empty page which says “Hello!” it keeps downloading me test.php on my computer (when I connect to http://myip/test.php")!
Please note: ‘test.php’ is in /var/www/html with index.html and many other .html files that work correctly.
If I type
php -v in the command-line it says that php 7.0.22-0ubuntu0.16.04.1 is installed.
With LAMP i got installed Ubuntu 16.04 and Apache 2.4.18 (Ubuntu).
When I type
a2enmod php7.0 it says “Module php7.0 alredy enabled”.
I’m quite a newbie, so please help me… I have been searching for a solution for 2 days
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $100 of credit to try our products over 60 days!