Apache, PHP and Windows XP

Posted on 2005-03-18
Medium Priority
Last Modified: 2013-12-13
I had this working last week and previously on other machines... and I'm about to remove & re-install for a second time since!

I've got Apache 1.3 installed, PHP 4.3.7 (and MySQL as it happens...but that's not part of the problem) on a Windows XP machine.  It's just my workstation & I use it for testing web sites before making them live.

Every time I go to use a php page, I get an error in the main Apache error log:

[Fri Mar 18 16:36:22 2005] [warn] mod_mime: analyze_ct: cannot get media type from 'x-mapp-php4'

... and the php page does nothing.

I have a test page (test.php) with simply:


... and I get a blank page back in the browser and the entry in the error log.  I have a shed-load of other php pages that perform the same, but figured I'd point out the simplest here.

Pertinent entries in the httpd.conf:

LoadModule php4_module "C:/Program Files/php/sapi/php4apache.dll"
AddModule mod_php4.c

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html

<IfModule mod_mime.c>
    AddType application/x-httpd-php      .php

As you can see PHP is set up in the C:\Program Files\php directory & the cli version works a treat.  The php.ini is in the %SYSTEMROOT% and the php4ts.dll is in the %SYSTEMROOT%\SYSTEM32.

I've tried adding the following line to the mod_mime.c section of httpd.conf also, but with no change to the symptoms after a restart of Apache (killed the logs to be sure!):

    AddType application/x-mapp-php4      .php

Any ideas why it's all not gelling together?  Unless there's a snappy answerer (I'm just about to go home for the weekend), I won't be looking at the matter until Monday (GMT) morning.
Question by:Barthax
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 19

Author Comment

ID: 13576285
No errors in event log, either...

Assisted Solution

pmrussell892 earned 1000 total points
ID: 13579195
Since you only use the server you might want to try out XAMPP for windows from http:///www.apachefriends.org

They have a nice package with an automated installer.

Expert Comment

ID: 13579207
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.


Accepted Solution

gerodim earned 1000 total points
ID: 13585884
Try my best too
 WAMP5 (windows apache mysql php5 package)

LVL 19

Author Comment

ID: 13591981
OK, uninstalled Apache, MySQL & deleted the php folder.  Deleted php.ini from the Windows directory & php4ts.dll from the System32 directory.  Installed WAMP into C:\wamp (from the URL given) using the default settings apart from the DocumentRoot and did not install the example web pages.  I setup the default root & Virtual Hosts as mentioned above.

I get the error: [Mon Mar 21 15:24:48 2005] [warn] mod_mime: analyze_ct: cannot get media type from 'x-mapp-php4'

I've checked the registry and grepped the website for the text "mapp" - neither is found.  Have check the .php associations and they are still with Dreamweaver MX.

This is obviously something that goes beyond the install of Apache, MySQL & PHP.  Any tests or suggestions otherwise?
LVL 19

Author Comment

ID: 13592174
You are looking at a 24-carat dumb ass!

Grep of course, doesn't grep hidden files & .htaccess is a *nix-style hidden file... In the .htaccess, you guessed it... is:

AddType x-mapp-php4 .php

Many thanks for your time. :D

Expert Comment

ID: 13592194
what extension does you php script have on it?


LVL 19

Author Comment

ID: 13592521

Problem is fixed now, thanks. :)

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question