LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Configuring Apache to process .php5 files (https://www.linuxquestions.org/questions/linux-server-73/configuring-apache-to-process-php5-files-488232/)

usg 09-30-2006 08:08 AM

Configuring Apache to process .php5 files
 
I have an Apache 2 with PHP 5 (module) running locally for development. It works just fine, but my webhoster requires PHP 5 files to have the extension .php5 (.php files being interpreted as PHP 4 :rolleyes: ). Unfortunately, I have not been able to tweak my Apache to correctly process those files. I have the line

AddType application/x-httpd-php .php .php3 .php4 .php5

in my httpd.conf, but no luck - instead of to the PHP interpreter, .php5 files are sent straight to the browser, resulting in a download dialog :mad:

Any help on fixing this would be appreciated, as I'm not keen on keeping my files as .php and having to rename them to .php5 every time I want to upload them.

reddazz 09-30-2006 09:49 AM

Did you restart apache after making your changes? You may also need to add something like index.php5 in your DirectoryIndex section of your httpd.conf.

usg 09-30-2006 10:31 AM

I did, but it doesn't work nonetheless. :(

bulliver 09-30-2006 10:45 AM

Quote:

I did, but it doesn't work nonetheless.
Well it should, that's how you do it. Are you sure you are editing the correct config file? Are you sure it isn't in, say, some VirtualHost directive that doesn't apply?

But anyway, why don't you just keep your local files as *.php if it is working, and simply rename them when you upload to your webhost?

usg 09-30-2006 11:06 AM

Yes, I am sure. Other changes I've made in the same file have worked before.

Just noticed something strange. When I open a .php5 file in Firefox, the download prompt says, "You have chosen to open [filename].php5, which is a: PHP5 file". Whereas, if I open a directory with an index.php5 in it, it says, "You have chosen to open [empty string], which is a: application/x-httpd-php". That would mean the MIME type is recognized only in the second case. Neither file is interpreted as it should, however.

And I don't want to go the renaming route because it's a pain :(


All times are GMT -5. The time now is 05:32 AM.