473,883 Members | 3,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help on PHP

Hi, I begin to write PHP but run into problem already.
First, I do not know where to put my PHP code? Where is the IIS Root
Directory? (I'm using Windows XP).

I have run Installer... but when I open my browser and type:
http://localhost/hello.php, what I got is an error message:

<p>This PHP CGI binary was compiled with force-cgi-redirect enabled.
This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is
set, e.g. via an Apache Action directive.</p>
<p>For more information as to <i>why</i> this behaviour exists, see the
<a href="http://php.net/security.cgi-bin">manual page for CGI
security</a>.</p>
<p>For more information about changing this behaviour or re-enabling
this webserver,
consult the installation file that came with this distribution, or
visit
<a href="http://php.net/install.windows ">the manual page</a>.</p>

I really do not understand how to make my first PHP "Hello World"
works?

I will greatly appreciate of your help!
Thank you!

-Ted

Jun 22 '06 #1
18 7803

teddybear wrote:
Hi, I begin to write PHP but run into problem already.
First, I do not know where to put my PHP code? Where is the IIS Root
Directory? (I'm using Windows XP).


Your root directory is c:\Inetpub\wwwr oot

Jun 22 '06 #2
teddybear
6 New Member
Thanks for your suggestion on the root directory. Now I have put it there, but still gave me error with the same message when I call it from the web browser: http://127.0.0.1/hello.php.

Here is the error message:
<p>This PHP CGI binary was compiled with force-cgi-redirect enabled.
This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is
set, e.g. via an Apache Action directive.</p>
<p>For more information as to <i>why</i> this behaviour exists, see the
<a href="http://php.net/security.cgi-bin">manual page for CGI
security</a>.</p>
<p>For more information about changing this behaviour or re-enabling
this webserver,
consult the installation file that came with this distribution, or
visit
<a href="http://php.net/install.windows ">the manual page</a>.</p>

I do not know where to fix??
Jun 22 '06 #3
WhatsPHP wrote:
teddybear wrote:
Hi, I begin to write PHP but run into problem already.
First, I do not know where to put my PHP code? Where is the IIS Root
Directory? (I'm using Windows XP).


Your root directory is c:\Inetpub\wwwr oot


Thanks for reminding me that I have to put my hello.php in the
C:\Inetpub\wwwr oot folder. I have put it there, but when I try to call
with http://127.0.0.1/hello.php,

the problem still there, it said:

<p>This PHP CGI binary was compiled with force-cgi-redirect enabled.
This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is
set, e.g. via an Apache Action directive.</p>
<p>For more information as to <i>why</i> this behaviour exists, see the
<a href="http://php.net/security.cgi-bin">manual page for CGI
security</a>.</p>
<p>For more information about changing this behaviour or re-enabling
this webserver,
consult the installation file that came with this distribution, or
visit
<a href="http://php.net/install.windows ">the manual page</a>.</p>

What is the problem? Can it be that I have to point in the PATH where
the PHP compiler is? Or should I modify the REDIRECT_STATUS CGI
variable as stated above, and where I can find the REDIRECT_STATUS
variable?
Please help and thank you!

--Ted

Jun 22 '06 #4
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

First thing you need to do is change the line in php.ini so it is
cgi.force_redir ect = Off

Then - and this is where I tore my hair out for a while - if you have
your php.ini in the /windows directory, ensure there there isn't also a
default php.ini in the PHP directory as it seems to read that one
first.

Or, why not just have it in the PHP directory and save a lot of
heartache :o)

Jun 22 '06 #5
teddybear
6 New Member
Okay, I read and follow your reply... I found there is PHP.ini in my /windows directory. And then, I found out that there is also another PHP.ini in my /PHP directory.

Your suggestion is to DELETE the one inside windows directory. Do I interpret your suggestion correctly?

And then, change the cgi.force_redir ect = 0?

Here is the section regarding cgi.force_redir ect from PHP.ini inside /PHP folder:
----
; cgi.force_redir ect is necessary to provide security running PHP as a CGI under
; most web servers. Left undefined, PHP turns this on by default. You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redir ect = 1
------

And here is the one inside my PHP.ini in the /Windows folder:
------
; cgi.force_redir ect is necessary to provide security running PHP as a CGI under
; most web servers. Left undefined, PHP turns this on by default. You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redir ect = 1
cgi.force_redir ect = 0

-----

The one in the /windows directory says cgi.force_redir ect = OFF?
While the one in the /PHP directory is commented, so it has no effect.

Now, what else I have to do if I have to let only the one in /PHP directory, if there are more steps to be done... should I restart my computer so the modified PHP.ini have the effect?

Thanks...

--Ted
Jun 22 '06 #6
I have replied you on the scripts.com forum. Thanks, and I am looking
forward to your reply!

WhatsPHP wrote:
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

First thing you need to do is change the line in php.ini so it is
cgi.force_redir ect = Off

Then - and this is where I tore my hair out for a while - if you have
your php.ini in the /windows directory, ensure there there isn't also a
default php.ini in the PHP directory as it seems to read that one
first.

Or, why not just have it in the PHP directory and save a lot of
heartache :o)


Jun 22 '06 #7
teddybear
6 New Member
Well, I am not aware that this forum apparently link to the one in google group.

Now, I got different problem. I have set the PHP.ini in the \PHP directory with
cgi.force_redir ect = 0

So, that should override the one in the /windows directory. But when I call my hello.php, my browser said: "Page Could Not Be Found"

Why is it so? I already put my Hello.php both in the /wwwroot directory and /PHP directory...

Another problem again and do not know where to fix? Please help!
Thanks!
Jun 22 '06 #8
I have another problem now. My browser said "Page Coult Not Be Found".
However I have set cgi.force_redir ect = 0 in the PHP.ini inside /PHP
directory,
And I have put Hello.PHP both in the /wwwroot directory and /PHP
directory.
Can you please suggest me what is the problem this time?

Thank you for help!

--Ted

teddybear wrote:
I have replied you on the scripts.com forum. Thanks, and I am looking
forward to your reply!

WhatsPHP wrote:
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

First thing you need to do is change the line in php.ini so it is
cgi.force_redir ect = Off

Then - and this is where I tore my hair out for a while - if you have
your php.ini in the /windows directory, ensure there there isn't also a
default php.ini in the PHP directory as it seems to read that one
first.

Or, why not just have it in the PHP directory and save a lot of
heartache :o)


Jun 22 '06 #9
My friend, where are you going? Anybody out there, please help???
I am stuck...

teddybear wrote:
I have another problem now. My browser said "Page Coult Not Be Found".
However I have set cgi.force_redir ect = 0 in the PHP.ini inside /PHP
directory,
And I have put Hello.PHP both in the /wwwroot directory and /PHP
directory.
Can you please suggest me what is the problem this time?

Thank you for help!

--Ted

teddybear wrote:
I have replied you on the scripts.com forum. Thanks, and I am looking
forward to your reply!

WhatsPHP wrote:
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

First thing you need to do is change the line in php.ini so it is
cgi.force_redir ect = Off

Then - and this is where I tore my hair out for a while - if you have
your php.ini in the /windows directory, ensure there there isn't also a
default php.ini in the PHP directory as it seems to read that one
first.

Or, why not just have it in the PHP directory and save a lot of
heartache :o)


Jun 23 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2492
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its last year we got traffic of between 2000 - 2500 unique visitors per day. We are now about to re-launch the site from Sweden and we need to purchase a script to run it. Having looked at what is available on the net I have realised that we need a...
7
4394
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a few features that you'd expect in any editor, except nearly none of them seem to have: 1 - Search and repalce with Regular Expressions. 2 - Search and Replace in an Xpath context. 3 - User specified tag-generation for either on a...
8
2852
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl list class must Ioverride in order for this to work?
2
1956
by: Michael R. Pierotti | last post by:
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$") Dim m As Match = reg.Match(txtIPAddress.Text) If m.Success Then 'No need to do anything here Else MessageBox.Show("You need to enter a valid IP Address", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Hand) txtIPAddress.Focus() Return End If
8
2759
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only the sequence nos and it should be such that i can access it through the structure .plz help me .
11
4511
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any AutoNumber* fields in them. Correct me if I'm wrong, but I'm assuming this means that I cannot now alter these existing Access tables and change their primary key to an "AutoNumber" type. If I'm right about this, I need some suggestions as to the...
0
3977
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
8
3027
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
20
4335
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
15
2182
by: Jess | last post by:
Hello, Sometimes declarations are all what we need when we define/declare classes (or functions?), but sometimes we need definitions. I learned that if we define a class (B) that has an object (a_obj) of a class type (A), then we need to define A as well, but if B has a pointer to A, then we only need to forward declare A. I was told this is because the compiler needs to see the implemenation of A when allocating memory for a_obj. ...
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7977
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6005
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4622
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.