Author |
|
mariachi77
Joined: 23 Apr 2007 Posts: 6 Location: Taiwan
|
Posted: Mon 23 Apr '07 8:04 Post subject: Use PHP without changing httpd.conf? |
|
|
Hi,
We had 3 production servers with different configurations and in the midst of documenting the changes, we discovered that one of the servers didn't even have any AddType / AddHandler declarations for PHP in its httpd.conf file. Nonetheless, it still executed PHP scripts without issue.
Does anyone know of any way to setup Apache to run PHP without using AddType or AddHandler declarations in the httpd.conf file? Any thoughts would be appreciated.
Cheers! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 23 Apr '07 10:06 Post subject: |
|
|
Maybe it is setup in a vhost. Any includes in the httpd.conf?
restarted the server? |
|
Back to top |
|
mariachi77
Joined: 23 Apr 2007 Posts: 6 Location: Taiwan
|
Posted: Mon 23 Apr '07 10:39 Post subject: |
|
|
Includes in the httpd.conf might be it -- but just to confirm, there MUST be AddType or AddHandler directives in order for PHP to work with Apache, right? There's simply no other way, correct? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 23 Apr '07 13:42 Post subject: |
|
|
There is a different way. But not easy!
You can turn on xbithack on in a vhost or generell in httpd.conf
Parses files with executable bit set as PHP regardless of their file ending. But sometimes there are conflicts with picutres.
xbithack manual |
|
Back to top |
|
mariachi77
Joined: 23 Apr 2007 Posts: 6 Location: Taiwan
|
Posted: Tue 24 Apr '07 4:55 Post subject: |
|
|
Yeah, I'm pretty sure we weren't using that way to execute scripts. The AddType or AddHandler directives must have been in the included conf scripts.
Thanks for your help in clearing up this mystery. |
|
Back to top |
|
mariachi77
Joined: 23 Apr 2007 Posts: 6 Location: Taiwan
|
Posted: Thu 26 Apr '07 7:28 Post subject: |
|
|
Just wanted to leave a definitive reason for why there were no AddType or AddHandler directives in our httpd.conf: RedHat and Apache 2.0 puts .conf files for packages in the /etc/httpd/conf/conf.d/ directory. So, the PHP-related directives would have been in that directory.
More info here:
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/ch-httpd.html
(have a look at section 10.1.3) |
|
Back to top |
|