LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-30-2006, 08:08 AM   #1
usg
LQ Newbie
 
Registered: Oct 2005
Location: Aachen, DE
Distribution: Mandriva 2009
Posts: 17

Rep: Reputation: 0
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 ). 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

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.
 
Old 09-30-2006, 09:49 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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.
 
Old 09-30-2006, 10:31 AM   #3
usg
LQ Newbie
 
Registered: Oct 2005
Location: Aachen, DE
Distribution: Mandriva 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I did, but it doesn't work nonetheless.
 
Old 09-30-2006, 10:45 AM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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?
 
Old 09-30-2006, 11:06 AM   #5
usg
LQ Newbie
 
Registered: Oct 2005
Location: Aachen, DE
Distribution: Mandriva 2009
Posts: 17

Original Poster
Rep: Reputation: 0
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

Last edited by usg; 09-30-2006 at 11:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP5 on Apache saving .php files Skip-DMP Linux - Enterprise 2 08-03-2006 08:25 AM
PHP5.0.4 FCGI Process maxing resources neocookie Linux - Software 2 11-02-2005 07:23 AM
Apache and PHP5 Mogatu Linux - Software 3 06-17-2005 03:43 PM
Problems configuring apache for php5 Besnell Mandriva 3 12-28-2004 09:01 AM
Configuring PHP5 in Redhat 9 asheikh Linux - Software 3 07-24-2004 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration