Page 1 of 2
Another Newbie - Error Installing PHP 5.2 with Apache 1.3
Posted: Mon Jan 01, 2007 12:14 pm
by attraxion
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi All,
I'm a big newbie with all this, and I'm trying to install PHP 5.2 under Apache 1.3, my OS is Win XP. I first installed Apache and it is working fine. Please go through the following steps / file fragments and tell me where I'm going wrong in installing PHP.
1- I unzipped the PHP files to C:/Programming/PHP, and also copied the dll's to the system32 directory.
2- I copied the php.ini-dist file to the windows directory (renamed as php.ini) and added the following to it -
Code: Select all
doc_root = "C:/Programming/Apache Group/Apache/htdocs"
extension_dir = "C:/Programming/PHP/ext"
Also I turned on extensions for various things.
3- Then I added the following lines to the httpd.conf file -
Code: Select all
LoadModule php5_module "C:/Programming/PHP/php5apache.dll"
Addmodule mod_php5.c
AddType application/x-httpd-php .php
Action application/x-httpd-php "php/php.exe"
Then when I made a test.php in the Apache htdocs directory, it gives me a 400 Bad Request. If I comment out the "Action application/x-httpd-php "php/php.exe" line from the httpd file, it gives me the option of downloading the file (that means it is finding the file, I guess. It doesn't know what to do with it.)
But over here on DevNetwork when I was looking at similar queries by others, I did not see any action line added in their httpd files. Is that because they're using Apache 2?
Please tell me where I'm going wrong, I'm quite frustrated by now. Thanks a lot in advance.
Best,
Attraxion.
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Re: Another Newbie - Error Installing PHP 5.2 with Apache 1.
Posted: Mon Jan 01, 2007 2:13 pm
by Oren
attraxion wrote:But over here on DevNetwork when I was looking at similar queries by others, I did not see any action line added in their httpd files. Is that because they're using Apache 2?
I use Apache 2 and this is pretty much all I added to the httpd.conf file:
Code: Select all
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
Don't forget to restart Apache after you make changes and only then check if it works or not

Posted: Mon Jan 01, 2007 3:04 pm
by volka
attraxion wrote:But over here on DevNetwork when I was looking at similar queries by others, I did not see any action line added in their httpd files. Is that because they're using Apache 2?
php is installed either as module or as cgi. LoadModule and Action at the same time in the same scope would be mixing both, that's not possible the way you did it.
Take a look at
http://www.php.net/manual/en/install.wi ... pache1.php and
http://www.apachefriends.org/en/xampp.html
Posted: Mon Jan 01, 2007 9:45 pm
by attraxion
volka wrote:php is installed either as module or as cgi. LoadModule and Action at the same time in the same scope would be mixing both, that's not possible the way you did it.
Okay, but the thing is when I remove the Action line then my browser starts downloading the test.php file rather than do anything with it. What could be the reason for that?
Best,
Attraxion.
Posted: Mon Jan 01, 2007 10:01 pm
by neel_basu
I wuold Suggest You
1. First Uninstall Your Existing Apache Installetion
2. Download
XAMP
3. Install It
It Would Install Apache + php + MySQL +......... By itshelf
It Would be Much more easier
Posted: Mon Jan 01, 2007 10:51 pm
by attraxion
Yes, that would be good and easy I know.. but I want to give this installation a shot (call it a mad desire on doing things by myself

, makes me feel happy ) Please continue to help me guys, I'll go in for xamp only if I cannot resolve this in 1-2 days.
Best,
Attraxion.
Posted: Mon Jan 01, 2007 10:57 pm
by volka
attraxion wrote:Okay, but the thing is when I remove the Action line then my browser starts downloading the test.php file rather than do anything with it. What could be the reason for that?
a misconfiguration

Is there something like
ClearModuleList in your httpd.conf?
Posted: Mon Jan 01, 2007 10:57 pm
by neel_basu
Well Thats A Very Good Idea
Posted: Mon Jan 01, 2007 11:16 pm
by neel_basu
search Your httpd.conf file Where the "LoadModule" (s) are ( some of Them Are in # Prefixed )
Add Just Bellow Of The Last LoadModule the following
Code: Select all
LoadModule php5_module c:\Your_php_directory\php5\php5apache2.dll
Next Search AddType Section there is something like
AddType application/x-tar .tgz
AddType image/x-icon .ico
Add The Following Type Just Bellow it
Code: Select all
AddType application/x-httpd-php .php .phtml .html .other_extions_Separated_By_Spaces_If_You_want_to_Be_Parsed_As_php
Code: Select all
Move php.ini-recomended file to the C:\Windows\ and Rename It to php.ini
Move php5ts.dll To C:\windows\system\
Restart Apache Server
Posted: Tue Jan 02, 2007 8:08 am
by attraxion
Hi Volka, yes there is a ClearModuleList in my httpd.conf file.
Hi Neel, I followed all your steps (most of the things were already there, as my first post said). And curiously enough, I am now getting '404 Not Found' error instead of the Bad Request earlier.
What could be the error?
Best,
Attraxion.
Posted: Tue Jan 02, 2007 8:18 am
by volka
attraxion wrote:Hi Volka, yes there is a ClearModuleList in my httpd.conf file.
The AddModule directive must be after that ClearModuleList (since ClearModuleList removes the module). The other AddModule lines are at the correct place in the default httpd.conf and therefore the step-by-step howto neel_basu gave you did the trick. (btw: apache2 has no ClearModuleList directive)
DocumentRoot in your httpd.conf points to the directory you can access via
http://localhost/
Place a file test.html in that directory and request it,
http://localhost/test.html
If that works place a file test.php in that directory and call
http://localhost/test.php
Posted: Tue Jan 02, 2007 8:38 am
by attraxion
Hi Volka, please notice that Neel's directions do not have an Addmodule command, only LoadModule and Addtype. Indeed, when apart from these I insert an AddModule command it says "already loaded module" in the Apache test configuration application.
The other steps you mentioned work fine -
document root is C:/Programming/Apache Group/Apache/htdocs
test.html in this directory is working
test.php is not working

fully frustrated by now,
Attraxion.
Posted: Tue Jan 02, 2007 9:46 am
by volka
Take xampp.
If you must do it on your own start from scratch. Do not try to repair it. De-install apache, remove the whole directory and start anew. Follow
http://www.php.net/manual/en/install.wi ... pache1.php exactly, step-by-step.
Posted: Tue Jan 02, 2007 9:59 am
by neel_basu
look I Do This Whenever I Set up My Home Server And Thats A Very
Fresh Installation
I Just Install Apache
2
You Can Download Apache2 From
http://www.eng.lsu.edu/mirrors/apache/h ... no_ssl.msi
Then I Install php 5 ( Extract the zip file And Do Copy Paste )
You Can Download from php 5 from
http://in.php.net/get/php-5.2.0-Win32.zip/from/a/mirror
And Then I Enter The conf Directory
Edit The httpd.conf file
Then Do The Above mentioned
And That Works Fine
I think You Have Changed So many Things in your httpd.conf file
Download That Files And Then Do A
Fresh Installetion
I Belief You Would Succedd
EDIT
{
But First Remove Your Previously Installed Aplications
Uninstall Previously Installed Apache And php
}
Posted: Tue Jan 02, 2007 11:19 am
by attraxion
I downloaded xampp... so much for my mad idealism
Its working fine. I decided it would be wiser to spend time on the language rather than on the install only. Thanks a lot (especially Volka and Neel) for all your replies and help, I will continue to bother you when I begin to make my own website

These forums rock !!
Best,
Attraxion.