How can i watch the PHP preview on browser?

I installed all the LAMP and my file.php is inside /var/www, but when i try to open my file.php on browser for watch the preview the browser ask me a open/download of my file.php.. And the page is blank. Please help me i tried all kind off solutions online but anything works!

2

2 Answers

I am still new, but am working on something similar. My files are in var/www/html. Not sure if moving them to the html folder would help, but might be work a shot. Also, are you accessing from localhost? If you are developing locally, you should be able to type in localhost in your browser and see a file directory, you can also try localhost/(yourfilename).php

You need to install libapache2-mod-php5 and then you need to enable it by : a2enmod php5 and finally restart apache and will works.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like