LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   web browsers try to open PHP files in gedit (https://www.linuxquestions.org/questions/linux-newbie-8/web-browsers-try-to-open-php-files-in-gedit-644309/)

digital_citizen 05-23-2008 10:34 AM

web browsers try to open PHP files in gedit
 
Have recently got my Ubuntu edgy system up & online, connected serially to an XP box connected to a modem.

On the XP box, php works fine but using both epiphany and firefox some php sites (asobrain.com, etc.) just ask if I want to open php script in gedit, or save to disk.
Have checked firewall and updated/re-installed php5-cli. Would the connection type have any effect?

b0uncer 05-24-2008 03:10 AM

Maybe configure your browser to open files of type php with program php5-cli?

If a web server has php pages, they should usually execute in the server, and the client should only get "the results". Though if you insist on grabbing a php file and executing it yourself, you can do so but you then have to tell the program that opens the php file which program it should use to execute it. If your browser doesn't know about php files, it just "sees" it's a plaintext file and the two usual things to do with such files are to view them, or save the file to disk.

fbianconi 07-06-2008 12:50 PM

Have you modified gnome 'open with' option for php files? (asuming you use gnome)
Try to set php 'open with' file property to launch either of those (Ephy or FF) if this is some kind of workaround, report it as a bug (I think that in desktop-integration thread). It shouldn't happen.
What I think is happening is this:
php and html files are ascii files both, so the way to differenciate those is by their content. If a mime-type is looked up by extension only, it could be wrong (actually if you look inside a *.php given by a php capable server it's really an html file). So when you try to visit a url ending in .php they think that it is a file to download and try to open (with a system linked app like gedit).


All times are GMT -5. The time now is 11:10 PM.