logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Use PHP without changing httpd.conf?
Author
mariachi77



Joined: 23 Apr 2007
Posts: 6
Location: Taiwan

PostPosted: Mon 23 Apr '07 8:04    Post subject: Use PHP without changing httpd.conf? Reply with quote

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

PostPosted: Mon 23 Apr '07 10:06    Post subject: Reply with quote

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

PostPosted: Mon 23 Apr '07 10:39    Post subject: Reply with quote

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

PostPosted: Mon 23 Apr '07 13:42    Post subject: Reply with quote

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

PostPosted: Tue 24 Apr '07 4:55    Post subject: Reply with quote

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

PostPosted: Thu 26 Apr '07 7:28    Post subject: Reply with quote

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


Reply to topic   Topic: Use PHP without changing httpd.conf? View previous topic :: View next topic
Post new topic   Forum Index -> Other Software