473,473 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

setting Apache up to process an extension as PHP

Our old Apache and PHP, in httpd.conf we have the following:
#
# These types cause httpd to let the PHP interpreter handle files
with
# the specified extensions.
#
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml .bkk
..html
AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3 .bkk .html
AddType application/x-httpd-php3-source .phps
</IfModule>
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml .php .bkk .html
</IfModule>

This obviously has allowed us to process .bkk and .html files as PHP.
We're migrating to a new server with Apache 2.0.52 and PHP 4.3.9, and I
can't find in httpd.conf anything that looks like that. In fact, a file
search comes up with NO reference of PHP in httpd.conf. (I know PHP
works fine because I can make a phpinfo.php page with phpinfo() and it
shows up just fine.)

Where in httpd.conf can I put something that will tell it to treat .bkk
and .html as PHP files?

Thanks for any advice!
Liam

Nov 22 '05 #1
4 1531
OK, found this line in httpd.conf:
TypesConfig /etc/mime.types

In that file is a huge list of file types. A search turned up no
reference to "php" however.
Just to test things, I tried inserting:

# PHP
application/x-httpd-php bkk
application/x-httpd-php htm
application/x-httpd-php html

but that didn't change anything.
I think I'm on the right track, this is probably where I need to add
whatever I need to add, but maybe I have the "application/x-httpd-php"
part wrong.

Can't seem to find any hits searching for mime.types and php though.

Any suggestions?
Thanks!
Liam

Nov 22 '05 #2
ne**@celticbear.com wrote:
OK, found this line in httpd.conf:
TypesConfig /etc/mime.types

In that file is a huge list of file types. A search turned up no
reference to "php" however.
Just to test things, I tried inserting:

# PHP
application/x-httpd-php bkk
application/x-httpd-php htm
application/x-httpd-php html

but that didn't change anything.
I think I'm on the right track, this is probably where I need to add
whatever I need to add, but maybe I have the "application/x-httpd-php"
part wrong.

Can't seem to find any hits searching for mime.types and php though.

Any suggestions?


On my server (Fedora Core 3) I have /etc/httpd/conf.d/php.conf. Perhaps
you do too?

Apache 2.0 has an include file facility that allows things like PHP to
isolate themselves to their own standard configuration files instead of
polluting httpd.conf with potentially hundreds of lines. Apache will
read all files in the conf.d directory and include them.
--
I used to be clueless about math, but I turned that around 360 degrees.
Nov 22 '05 #3

Andrew DeFaria wrote:
ne**@celticbear.com wrote:

[..]
Can't seem to find any hits searching for mime.types and php though.

Any suggestions?


On my server (Fedora Core 3) I have /etc/httpd/conf.d/php.conf. Perhaps
you do too?

Apache 2.0 has an include file facility that allows things like PHP to
isolate themselves to their own standard configuration files instead of
polluting httpd.conf with potentially hundreds of lines. Apache will
read all files in the conf.d directory and include them.


Ah! Excellent. Hadn't known about that. Pretty useful, and it works!
Thanks
-Liam

Nov 22 '05 #4
JDS
On Tue, 15 Nov 2005 09:52:45 -0800, news wrote:
Ah! Excellent. Hadn't known about that. Pretty useful, and it works!
Thanks
-Liam


In fact, a bunch of things are in that conf.d directory. It would behoove
you to look at them.

I had a similar experience as yours just last week and found that the
items in (or not in) conf.d were what was causing me troubles.

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Nov 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: RC | last post by:
First, let me say I couldn't find a group discuss XML/XSLT. So I only choose the closest groups to post this message. Here is part of my *.xsl file <xsl:stylesheet...
2
by: codesmithsf | last post by:
I'm using PHP 4.2.2 and Apache 2.0.4.0. A script running on a virtual host had an endless loop in it that brought Apache to its knees. I have max_execution_time=90 and memory_limit=32M to...
14
by: Jim Carlock | last post by:
I have a couple easy questions possibly. 1) Is there a default.php page? The webserver seems to support default.htm, default.html, index.htm and index.html. It's an Apache server, I'd like to...
3
by: Joseph S. | last post by:
Hi, I am trying to install PHP 5.0.4 on Apache 2.0.54 on WinXP Pro SP2 as a cgi binary. Apache2 directory is c:/Apache2 htdocs is c:/Apache2/htdocs php is installed in c:/php This contains...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
6
by: MaiyaHolliday | last post by:
Hello, I've recently installed apache on a new computer, and cannot figure out why my site will not process any includes. (it was working on my old one) There are no errors on the page such as...
5
by: Guillermo Antonio Amaral Bastidas | last post by:
Hi everybody, I have a quick and probably dumb question, keep in mind I just dumped my old love FastCGI + Perl for it's younger hotter friend PHP5. If the user calls a time consuming script...
9
by: Christopher Koeber | last post by:
Hello, I am attempting to perform a PHP installation on an Apache 2.2.6 web server instance that is loaded on a Windows 2003 server operating system (R2 SP2). I have a third party application...
6
by: josequinonesii | last post by:
I've searched, I've read, I've tested and re-read numerous post but to no avail yet... Quite simply, the settings I've applied to my httpd.conf, httpd-vhost.conf and my hosts files simply does not...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.