how can i configure php with apache

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saadatshah
Forum Newbie
Posts: 23
Joined: Fri Jul 05, 2002 5:50 am
Location: Lahore

how can i configure php with apache

Post by saadatshah »

hi all,

i ve installed apahe version 1.3.26 on my win2k professional.....

under the current folder...

"D:\Program Files\Apache Group\Apache\"

and the installed location of PHP4.2.6 is

"D:\php"

now tell me what directive i ve 2 set in httpd.conf.....so that apahe can handle all php requests.....

need and urgent reply.....

advance thx 2 all
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

According to this thread, you do this:

Code: Select all

ScriptAlias /php/ "d:/php/"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php "/php/php.exe"
saadatshah
Forum Newbie
Posts: 23
Joined: Fri Jul 05, 2002 5:50 am
Location: Lahore

Post by saadatshah »

hi ,
thx 4 the solution....now apache can handle php files...but there is another problem i m dealing with now.....

--------FILE URL is-----

http://php:8000/Magic/admin/admin.php

-----------------------

i m using the following code for setting the action parameter of the form tag.....

<form name="frmAdmin" action="<? print($_SERVER['SCRIPT_NAME']) ."?pst=1"; ?>" method="post">


when i post my form by clicking submit button...it 'll take me 2 a url....

http://php:8000/php/php.exe?pst=1


and in the source code of the file.....the action parameter of form looks like this

<form name="frmAdmin" action="/php/php.exe?pst=1" method="post">"

so now tell me what 2 do........
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

That's odd. I'm not sure why $_SERVER['SCRIPT_NAME'] contains the path to PHP. (It does it for me, too.)

But you could use $_SERVER['PHP_SELF'] instead.
Post Reply