Ask Your Question

php doesnt runs and browser downloads it

asked 2015-11-19 11:50:11 -0500

7eja5 gravatar image

updated 2015-11-19 13:27:28 -0500

I recently installed lamp in fedora 22 , i was testing out a php script and browser doesnt seem to run it . I checked phpinfo() and got the correct page also i can access phpmyadmin . Is there any problem related to permissions or some .conf file . Thanks for the help in advance .

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2015-11-20 14:50:46 -0500

7eja5 gravatar image

Yes , I have my files in /var/www/html folder , also I have made a basic php file that displays php info , it works . I made a sign in html page that uses php and mysql to authenticate , but instead of running the php script browser tries to download it . Thanks for the help in advance .

edit flag offensive delete link more


Just make sure that you reply to other answers using comments. It's gets crowded real quick if you don't. ^^

MetaNova gravatar imageMetaNova ( 2015-11-20 16:49:13 -0500 )edit

answered 2015-11-20 11:59:35 -0500

dabame gravatar image

Where is your .php file located? By default, apache is configured to serve files from /var/www/html/ . Put your file in that folder then point your browser to localhost/<filename>.php

edit flag offensive delete link more


Well, not sure then. The .conf file for php should be in /etc/httpd/conf.d/php.conf

# mod_php options
<IfModule  mod_php5.c>
    # Cause the PHP interpreter to handle files with a .php extension.
    <FilesMatch \.php$>
        SetHandler application/x-httpd-php

I'd double check you have the SetHandler set appropriately and that it is uncommented. Other than that I'm sorry I can't be more help

dabame gravatar imagedabame ( 2015-11-20 15:31:13 -0500 )edit

Question Tools

1 follower


Asked: 2015-11-19 11:50:11 -0500

Seen: 76 times

Last updated: Nov 20 '15