Help with PHP alias folder

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
flashkid
Forum Newbie
Posts: 3
Joined: Mon Jun 02, 2003 4:25 pm

Help with PHP alias folder

Post by flashkid »

Hi every one,

I am using win2K with IIS server.
I have installed php in the c:\php\php.exe and am using PHPmyAdmin and MySQL to develope a small website.

Using the the Internet Service Mananger i have mpped the scripts to c:\php\php.exe

I have created a folder test on the d drive and given it an Alias name of myphp using the PWS that runs with IIS.

The problem is that when i use http://localhost/myphp in the browser the php pages give me the follwing error


cgi error:
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:


now when i used some asp pages in the same folder they work fine.

also the same php files works fine when copied to c:\inetpub\wwwroot folder

I guess its some maping roblem or some thing that is not letting the php files execute from the d dirve or a ny other place excvept for the c:\inetpub\wwroot

can some please help mw with this ?
what is the solution to this problem.

thank you for your time.

P.S.im a newbie to PHP and MySQL

thank you for your time every one
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try running the script from a commandline window, e.g.

Code: Select all

"c:\program files\php\php.exe" -i c:\inetpub\php\myScript.php
See if errors raise.
Requests are handled with the permissions of the account ISUR_xyz (xyz beeing the name of your computer). Does this account have (read) access to both php and the script file?
In your php.ini there is a parameter doc_root. Does it point to the right directory?
In the internet services manager you may enable the check file exists option. If the script does not exist at all the IIS will return a 404 (but I thought this is default.?.)
flashkid
Forum Newbie
Posts: 3
Joined: Mon Jun 02, 2003 4:25 pm

Post by flashkid »

hi volka thanks for ur reply

i tried this
c:\php\php.exe" -i
and it didnt throw any errors

this i got to try
c:\inetpub\php\myScript.php

In my php.ini
doc_root = C:\Inetpub\wwwroot

should i make this doc_root = D:\test ??

thaanks for ur help
its really appriciated

thanks again
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

really depends on where your php scripts are located.
In my example I assumed the scripts are in c:\inetpub\php and the root-dir is c:\inetpub

Code: Select all

"c:\program files\php\php.exe" -i c:\inetpub\php\myScript.php
was meant as one command

Code: Select all

<path to php-exe> -i <path to script>
to see wether there is a configuration problem that hinders php from loading e.g. an extension
flashkid
Forum Newbie
Posts: 3
Joined: Mon Jun 02, 2003 4:25 pm

Post by flashkid »

hi :D
I dont know if this is the right way
In the PHP.ini file i did the following change
instead of
doc_root = C:\Inetpub\wwwroot

I put in this
doc_root = http://localhost/

so now nomatter where my alias folder is it works :-)

if this is wrong please do let me know.
BUt i got it working tough
User avatar
KissMyBrain
Forum Newbie
Posts: 2
Joined: Tue Jun 03, 2003 2:22 pm

Post by KissMyBrain »

hello!

i think you have not defined in the IIS that the php-files of your Homepage should be interpreted by the parser.

You have to add this function in the properties page of your Homepage in the IIS snap-in.

Your solution maybe work but i think this is the cause of your inital error.

bye

KMB
Post Reply