Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2008-03-20, 02:53 PM
Junior Member
 
Join Date: Mar 2008
Posts: 1
dcbc is on a distinguished road
Default browser ask if you want to download the php file instead of displaying it

hellow i am linux newbie.i want to learn php.
i use ubuntu ultimate edition 1.5
so i didn't install apache php etc.they came with the package.


when i save a file in /var/www directory
and try to view the page by
http://localhost/hello.php

the web browser(Firefox) asks if i want to download the php file instead of displaying it?
what should i do?

i checked this site

https://help.ubuntu.com/community/ApacheMySQLPHP
Troubleshooting

Does your browser ask if you want to download the php file instead of displaying it? If Apache is not actually parsing the php after you restarted it, install libapache2-mod-php4. It is installed when you install the php4 package, but may have been removed inadvertently by packages which need to run a different version of php. You may also need to actually enable it, by doing sudo a2enmod php4 followed by sudo /etc/init.d/apache2 restart. Be sure to clear your browser's cache before testing your site again.



^ tried the above solution.but nothing happend.

please help
Reply With Quote
  #2 (permalink)  
Old 2008-03-21, 03:07 PM
Junior Member
 
Join Date: Jan 2006
Location: Rhode Island, USA
Posts: 5
topnotcher
Send a message via AIM to topnotcher Send a message via MSN to topnotcher
Default

Your problem is likely that although you have the module installed (and why install the php4 mod instead of 5?), you don't have it enabled.

At any rate, your problem is indicative of the fact that the apache server doesn't know how to handle a .php file. The following line must be present in your httpd.conf:

AddType application/x-httpd-php .php

Further, you probably have not enabled the module. (LoadModule directive required.)

I haven't personally used ubuntu (and never intend to), but I do happen to admin some debian boxes (I hate debian too). On the debian boxes, the /etc/apache2 directory contains a mods-available and a mods-enabled directory. In my mods-available directory, I have a php5.load file and a php5.conf file. The .conf file has the above AddType directive, and the .load has the LoadModule. The apache2.conf file Includes *.load and *.conf from mods-enabled, so to enable the php 5 module, I would simply :

[as root]
cd /etc/apach2
ln -s mods-available/php5.load mods-enabled/php5.load
ln -s mods-available/php5.conf mods-enabled/php5.conf
/etc/init.d/apache2 reload


--Greg
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:20 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.