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 -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.2.3 on WinXP.SP2 Does Not Recognize .bat or .php
Author
djbranson



Joined: 22 Oct 2006
Posts: 8
Location: Lubbock, Texas

PostPosted: Sun 22 Oct '06 20:33    Post subject: Apache 2.2.3 on WinXP.SP2 Does Not Recognize .bat or .php Reply with quote

I have installed "apache 2.2.3-win32-x86-no ssl.msi" using the instructions at http://www.devshed.com/c/a/Apache/Configuring-and-Using-the-Apache-HTTP-Web-Server-on-a-Windows-XP-PC/. I also installed the php-5.1.6-win32. Html and shtml seem to be running okay, but I cannot get the .bat or .php parts to work. Below is a portion of what I have in the httpd.conf file:

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php php
ScriptAlias /_php/ "c:/php/"
Action application/x-httpd-php "/_php/php.exe"
AddHandler cgi-script .cgi .bat .pl
AddHandler server-parsed .html
AddType text/html .shtml
AddHandler server-parsed .shtml .html .htm
#AddOutputFilter INCLUDES .shtml
</IfModule>

Any advise to help me get these issues resolved would be appreciated.
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Mon 23 Oct '06 15:47    Post subject: Reply with quote

You try to run php as CGI, better to run as module.
To get php running as module it is advised to use the guide at www.apachelounge.com/viewtopic.php?t=570
Back to top
djbranson



Joined: 22 Oct 2006
Posts: 8
Location: Lubbock, Texas

PostPosted: Tue 24 Oct '06 6:11    Post subject: .bat works now, but .php still not working Reply with quote

I followed your tutorial (nicely written), I have developed a better grasp of how to configure Apache2.2.3. I am still doing something incorrectly, however, because php5.1.6 still doesn't respond. I don't see any errors in Apache2/log, but when I try http://localhost/test.php, I just get a blank page. Any further suggestions?
Back to top
djbranson



Joined: 22 Oct 2006
Posts: 8
Location: Lubbock, Texas

PostPosted: Tue 24 Oct '06 6:25    Post subject: It works! Reply with quote

I read some of the other posts, and then went into php.ini and edited it to set short_open_tag = On. After flushing my IE6 buffers, I tried it again and it worked. Thanks for the help.
Back to top
brain009



Joined: 04 Nov 2006
Posts: 2

PostPosted: Sat 04 Nov '06 18:13    Post subject: PHP not working on Apache Reply with quote

I am trying to install PHP, MySQL, and Apache on Windows XP. I followed the instructions from http://www.devarticles.com/c/a/Apache/Installing-PHP-under-Windows/

Everything seemed to work great until I got to the part about testing php. When I goto http://localhost/test.php the code itself appears. I have been through the steps about 5 times and can't seem to find anything wrong, but you know how that goes. I would be happy to show someone my php.ini files and conf files if they could fix the problem!
Back to top
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Sat 04 Nov '06 18:26    Post subject: Reply with quote

The best thing I think you could do is search these forums, the solutions are within this forum in fact so I went to the top of the screen you are on now, and typed in "installing PHP", selected to search Apache lounge and came up with a number of matches to posts in Apache Lounge that can help you.

>>> Search Results for Installing PHP

That is the link you can use to get the same results.

The main thing is where would one begin to ask questions. For example, did you associate the PHP file type properly. Clearly Apache does not know it is supposed to handle the PHP file extension in the manner that would result in parsing and processing the code, it just dumps it out as plain text since it does not know what else to do.

So if you look at some of the other examples it may very well help you out. This is not all that uncommon at first, been there done that, LOL.

Compare your configuration to that of some of the posts here and then if you still have problems definately post at that point. Here is an example from another post showing a proper configuration in the httpd.conf file:
Code:
#Load the PHP module into Apache
LoadModule php5_module "c:/php/php5apache2.dll"

# Add the Mime Type Association
AddType application/x-httpd-php .php

#Tell the module where the PHP.INI file is located
PHPIniDir "c:/php"


Naturally the paths would be different for your environment, but this illustrates the basic configuration using the PHP Module, it would be different for FCGI.

Hope this gets you headed in the right direction, the answers are all here.

EDIT: I just thought of this, you probably don't have PHP enabled for the path that contains localhost/test.php, you need to be sure that PHP can execute in that path first.
Back to top
brain009



Joined: 04 Nov 2006
Posts: 2

PostPosted: Wed 15 Nov '06 3:28    Post subject: Reply with quote

Okay, I am still having no luck.

So I will try to be more specific.

I used the instructions here:
http://www.devarticles.com/c/a/Apache/Installing-PHP-under-Windows/

put the stuff where it told me to, can't seem to find anything wrong with my conf or .ini file, but when you look at your own work you seem to miss something.

I've looked over these posts but its like trying to find a needle in a haystack!


I'll be happy to post my conf and ini files if anyone asks.

Thanks
Back to top


Reply to topic   Topic: Apache 2.2.3 on WinXP.SP2 Does Not Recognize .bat or .php View previous topic :: View next topic
Post new topic   Forum Index -> Apache