First PHP program not working

First PHP program not working

am 29.04.2009 01:47:49 von Vinay Nagrik

--0016e64b973c2b1f530468a61705
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello Group,

I am beginner to learning PHP and I am still struggling to start my first
php program.

I downloaded apache httpd sever, which resides on "Windows XP" under

C:\Program Files\Apache Software Foundation\Apache2.2

and directories therein.

Similarly the PHP download resides under

C:\Program Files\PHP

I have made following configuration changes to httpd file, which resides
under

C:\Program Files\Apache Software Foundation\Apache2.2\conf

although it does not show .conf extenstion, but I believe even without .conf
extension "Which is hidden", it is the appropriate conf file.

The changes

ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
LoadModule php5_module C:\Program Files\php\php5apache2_2.dll
PHPIniDir "C:\Program Files\php\"
AddType applicaton/x-httpd-php .php

for php.ini I made following changes

extension_dir = "C:\Program Files\PHP"
extension=C:\Program Files\MySQL\MySQL Server5.1\bin\libmySQL.dll
doc_root = "C:\Pogram Files\Apache Software Foundation\Apache2.2\htdocs"

I have also created a .php test program, which reads like



and resides under htdocs directory under Apache installation.

The htdocs directory also has an html page.

The .html pages residing under htdpcs directory show themselves on following
URL, however .php pages do not

http://localhost/ shows "It Works"
http://localhost/index.html shows "It Works"

However,

http://localhost/test.php shows "404 error"

Can someone help me in configuring my httpd server for php files
--
Thanks

Nagrik

--0016e64b973c2b1f530468a61705--

Re: First PHP program not working

am 29.04.2009 13:32:32 von James Crow

Vinay Nagrik wrote:
> Hello Group,
>
> I am beginner to learning PHP and I am still struggling to start my first
> php program.
>
> I downloaded apache httpd sever, which resides on "Windows XP" under
>
> C:\Program Files\Apache Software Foundation\Apache2.2
>
> and directories therein.
>
> Similarly the PHP download resides under
>
> C:\Program Files\PHP
>
> I have made following configuration changes to httpd file, which resides
> under
>
> C:\Program Files\Apache Software Foundation\Apache2.2\conf
>
> although it does not show .conf extenstion, but I believe even without .conf
> extension "Which is hidden", it is the appropriate conf file.
>
> The changes
>
> ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
> LoadModule php5_module C:\Program Files\php\php5apache2_2.dll
> PHPIniDir "C:\Program Files\php\"
> AddType applicaton/x-httpd-php .php
>
> for php.ini I made following changes
>
> extension_dir = "C:\Program Files\PHP"
> extension=C:\Program Files\MySQL\MySQL Server5.1\bin\libmySQL.dll
> doc_root = "C:\Pogram Files\Apache Software Foundation\Apache2.2\htdocs"
>
> I have also created a .php test program, which reads like
>
>
>
> and resides under htdocs directory under Apache installation.
>
> The htdocs directory also has an html page.
>
> The .html pages residing under htdpcs directory show themselves on following
> URL, however .php pages do not
>
> http://localhost/ shows "It Works"
> http://localhost/index.html shows "It Works"
>
> However,
>
> http://localhost/test.php shows "404 error"
>
> Can someone help me in configuring my httpd server for php files
>
Error 404 is a standard web error. It does not come from php. When you
look through Windows Explorer is the test.php file in the same folder as
index.html? Something that may be helpful is to look at the Apache log.
From your email it would appear to be located at C:\Program
Files\Apache Software Foundation\Apache2.2\logs. There should be an
error.log (but you may not see the log part of the filename) and an
access.log.

First check to make sure that the test.php file is in the correct folder
and then check the log files.

Thanks,
James


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: First PHP program not working

am 29.04.2009 16:37:13 von Vinay Nagrik

--00163645883ef0fa0b0468b28305
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello Group,

Till yesteday, the .html file under htdocs were working fine under

http://localhost/index.html

but today the same URL

http://localhost/index.html gives 404 error.

My guess is that my apache web server is not working.

Can someone tell me

"How do I make sure that I am running Apache httpd server."

Besides, yesterday when my .html files were working under
http://localhost/URL, and .php files were not working the log says the
following.

#################
Apr 28 07:43:01 2009] [notice] Apache/2.2.11 (Win32) configured -- resuming
normal operations
[Tue Apr 28 07:43:01 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Apr 28 07:43:01 2009] [notice] Parent: Created child process 1296
[Tue Apr 28 07:43:01 2009] [notice] Child 1296: Child process is running
[Tue Apr 28 07:43:01 2009] [notice] Child 1296: Acquired the start mutex.
[Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting 64 worker threads.
[Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting thread to listen on
port 80.
[Tue Apr 28 13:53:17 2009] [error] [client 192.168.1.104] File does not
exist: C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/crossdomain.xml
[Tue Apr 28 14:47:45 2009] [error] [client 127.0.0.1] File does not exist:
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
#####################################

Can someone tell me what these two files are, what do they do, why are they
important, and why no liteature mentions about them.

Any help will be appreciated.

nagrik.

On Wed, Apr 29, 2009 at 4:32 AM, James Crow wrote:

> Vinay Nagrik wrote:
>
>> Hello Group,
>>
>> I am beginner to learning PHP and I am still struggling to start my first
>> php program.
>>
>> I downloaded apache httpd sever, which resides on "Windows XP" under
>>
>> C:\Program Files\Apache Software Foundation\Apache2.2
>>
>> and directories therein.
>>
>> Similarly the PHP download resides under
>>
>> C:\Program Files\PHP
>>
>> I have made following configuration changes to httpd file, which resides
>> under
>>
>> C:\Program Files\Apache Software Foundation\Apache2.2\conf
>>
>> although it does not show .conf extenstion, but I believe even without
>> .conf
>> extension "Which is hidden", it is the appropriate conf file.
>>
>> The changes
>>
>> ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
>> LoadModule php5_module C:\Program Files\php\php5apache2_2.dll
>> PHPIniDir "C:\Program Files\php\"
>> AddType applicaton/x-httpd-php .php
>>
>> for php.ini I made following changes
>>
>> extension_dir = "C:\Program Files\PHP"
>> extension=C:\Program Files\MySQL\MySQL Server5.1\bin\libmySQL.dll
>> doc_root = "C:\Pogram Files\Apache Software Foundation\Apache2.2\htdocs"
>>
>> I have also created a .php test program, which reads like
>>
>>
>>
>> and resides under htdocs directory under Apache installation.
>>
>> The htdocs directory also has an html page.
>>
>> The .html pages residing under htdpcs directory show themselves on
>> following
>> URL, however .php pages do not
>>
>> http://localhost/ shows "It Works"
>> http://localhost/index.html shows "It Works"
>>
>> However,
>>
>> http://localhost/test.php shows "404 error"
>>
>> Can someone help me in configuring my httpd server for php files
>>
>>
> Error 404 is a standard web error. It does not come from php. When you look
> through Windows Explorer is the test.php file in the same folder as
> index.html? Something that may be helpful is to look at the Apache log. From
> your email it would appear to be located at C:\Program Files\Apache Software
> Foundation\Apache2.2\logs. There should be an error.log (but you may not see
> the log part of the filename) and an access.log.
>
> First check to make sure that the test.php file is in the correct folder
> and then check the log files.
>
> Thanks,
> James
>
>


--
Thanks

Nagrik

--00163645883ef0fa0b0468b28305--

Re: First PHP program not working

am 29.04.2009 16:51:54 von Richard Quadling

2009/4/29 Vinay Nagrik :
> Hello Group,
>
> Till yesteday, the .html file under htdocs were working fine under
>
> http://localhost/index.html
>
> but today the same URL
>
> http://localhost/index.html gives 404 error.
>
> My guess is that my apache web server is not working.
>
> Can someone tell me
>
> "How do I make sure that I am running Apache httpd server."
>
> Besides, yesterday when my .html files were working under
> http://localhost/URL, and .php files were not working the log says the
> following.
>
> #################
> Apr 28 07:43:01 2009] [notice] Apache/2.2.11 (Win32) configured -- resumi=
ng
> normal operations
> [Tue Apr 28 07:43:01 2009] [notice] Server built: Dec 10 2008 00:10:06
> [Tue Apr 28 07:43:01 2009] [notice] Parent: Created child process 1296
> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Child process is running
> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Acquired the start mutex.
> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting 64 worker thread=
s.
> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting thread to listen=
on
> port 80.
> [Tue Apr 28 13:53:17 2009] [error] [client 192.168.1.104] File does not
> exist: C:/Program Files/Apache Software
> Foundation/Apache2.2/htdocs/crossdomain.xml
> [Tue Apr 28 14:47:45 2009] [error] [client 127.0.0.1] File does not exist=
:
> C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
> #####################################
>
> Can someone tell me what these two files are, what do they do, why are th=
ey
> important, and why no liteature mentions about them.
>
> Any help will be appreciated.
>
> nagrik.
>
> On Wed, Apr 29, 2009 at 4:32 AM, James Crow wrote:
>
>>  Vinay Nagrik wrote:
>>
>>> Hello Group,
>>>
>>> I am beginner to learning PHP and I am still struggling to start my fir=
st
>>> php program.
>>>
>>> I downloaded apache httpd sever, which resides on "Windows XP" under
>>>
>>> C:\Program Files\Apache Software Foundation\Apache2.2
>>>
>>> and directories therein.
>>>
>>> Similarly the PHP download resides under
>>>
>>> C:\Program Files\PHP
>>>
>>> I have made following configuration changes to httpd file, which reside=
s
>>> under
>>>
>>> C:\Program Files\Apache Software Foundation\Apache2.2\conf
>>>
>>> although it does not show .conf extenstion, but I believe even without
>>> .conf
>>> extension "Which is hidden", it is the appropriate conf file.
>>>
>>> The changes
>>>
>>> ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdoc=
s"
>>> LoadModule php5_module C:\Program Files\php\php5apache2_2.dll
>>> PHPIniDir "C:\Program Files\php\"
>>> AddType applicaton/x-httpd-php .php
>>>
>>> for php.ini I made following changes
>>>
>>> extension_dir =3D "C:\Program Files\PHP"
>>> extension=3DC:\Program Files\MySQL\MySQL Server5.1\bin\libmySQL.dll
>>> doc_root =3D "C:\Pogram Files\Apache Software Foundation\Apache2.2\htdo=
cs"
>>>
>>> I have also created a .php test program, which reads like
>>>
>>>
>>>
>>> and resides under htdocs directory under Apache installation.
>>>
>>> The htdocs directory also has an html page.
>>>
>>> The .html pages residing under htdpcs directory show themselves on
>>> following
>>> URL, however .php pages do not
>>>
>>> http://localhost/             shows "It W=
orks"
>>> http://localhost/index.html             s=
hows "It Works"
>>>
>>> However,
>>>
>>> http://localhost/test.php             =C2=
=A0        shows "404 error"
>>>
>>> Can someone help me in configuring my httpd server for php files
>>>
>>>
>> Error 404 is a standard web error. It does not come from php. When you l=
ook
>> through Windows Explorer is the test.php file in the same folder as
>> index.html? Something that may be helpful is to look at the Apache log. =
From
>> your email it would appear to be located at C:\Program Files\Apache Soft=
ware
>> Foundation\Apache2.2\logs. There should be an error.log (but you may not=
see
>> the log part of the filename) and an access.log.
>>
>> First check to make sure that the test.php file is in the correct folder
>> and then check the log files.
>>
>> Thanks,
>> James
>>
>>
>
>
> --
> Thanks
>
> Nagrik
>

favicon.ico http://en.wikipedia.org/wiki/Favicon.ico
crossdomain.xml http://en.wikipedia.org/wiki/Cross-site_request_forgery

--=20
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
"Standing on the shoulders of some very clever giants!"

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: First PHP program not working

am 29.04.2009 17:29:21 von James Crow

Richard Quadling wrote:
> 2009/4/29 Vinay Nagrik :
>
>> Hello Group,
>>
>> Till yesteday, the .html file under htdocs were working fine under
>>
>> http://localhost/index.html
>>
>> but today the same URL
>>
>> http://localhost/index.html gives 404 error.
>>
>> My guess is that my apache web server is not working.
>>
>> Can someone tell me
>>
>> "How do I make sure that I am running Apache httpd server."
>>
>> Besides, yesterday when my .html files were working under
>> http://localhost/URL, and .php files were not working the log says the
>> following.
>>
>> #################
>> Apr 28 07:43:01 2009] [notice] Apache/2.2.11 (Win32) configured -- resuming
>> normal operations
>> [Tue Apr 28 07:43:01 2009] [notice] Server built: Dec 10 2008 00:10:06
>> [Tue Apr 28 07:43:01 2009] [notice] Parent: Created child process 1296
>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Child process is running
>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Acquired the start mutex.
>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting 64 worker threads.
>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting thread to listen on
>> port 80.
>> [Tue Apr 28 13:53:17 2009] [error] [client 192.168.1.104] File does not
>> exist: C:/Program Files/Apache Software
>> Foundation/Apache2.2/htdocs/crossdomain.xml
>> [Tue Apr 28 14:47:45 2009] [error] [client 127.0.0.1] File does not exist:
>> C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
>> #####################################
>>
>> Can someone tell me what these two files are, what do they do, why are they
>> important, and why no liteature mentions about them.
>>
>> Any help will be appreciated.
>>
>> nagrik.
>>
>> On Wed, Apr 29, 2009 at 4:32 AM, James Crow wrote:
>>
>>
>>>
>> --
>> Thanks
>>
>> Nagrik
>>
>>
>
> favicon.ico http://en.wikipedia.org/wiki/Favicon.ico
> crossdomain.xml http://en.wikipedia.org/wiki/Cross-site_request_forgery
>
>
On windows you can check the status of a service by running:

sc query apache2

from a command prompt. The process name may be apache22. There is also
the Services MSC SnapIn that can be opened from Control
Panel->Administrative Tools->Services icon. It will list the status of
all installed services.

You seem to have two problems:
1) Apache serving up 404 errors vice web pages
2) PHP scripts not executing

Fix Apache first before you worry about PHP. If there is an error in the
php.ini file it can cause Apache not to start. The error.log file I
mentioned earlier will show these types of errors though.

Cheers,
James

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: First PHP program not working

am 29.04.2009 18:04:35 von Vinay Nagrik

--00163646ca445ff7340468b3bc4d
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello Everybody,

I checked my services and my find is

Apache is installed and is suppsed to start in 'Automatic' mode following is
the entry in the Services

Name Description Status Startup
Type LogOn As
Apache Apache/2.2.11 (Win32) ------
Automatic Local System

However, the services does not start automatically, when I logon as an user
or as an administrator.

I tried starting 'Apache' manually by going into the installed software at
the bottom of the taskbar. While logged on as a user, it forces me to start
the service as an 'administrator', but then asks for the password. As far
as password is concerned for the administrator for Apache, "I do not have
any password" and it fails to start 'Apache'.

When I log on as administrator, even then it does not start Apache. When I
try to start Apache manually, it gives error message,

"Requested services failed."

I know I am missing one small point. And I know out there is somebody, who
must have encountered the same problem.

Please help.

nagrik.

On Wed, Apr 29, 2009 at 8:29 AM, James Crow wrote:

> Richard Quadling wrote:
>
>> 2009/4/29 Vinay Nagrik :
>>
>>
>>> Hello Group,
>>>
>>> Till yesteday, the .html file under htdocs were working fine under
>>>
>>> http://localhost/index.html
>>>
>>> but today the same URL
>>>
>>> http://localhost/index.html gives 404 error.
>>>
>>> My guess is that my apache web server is not working.
>>>
>>> Can someone tell me
>>>
>>> "How do I make sure that I am running Apache httpd server."
>>>
>>> Besides, yesterday when my .html files were working under
>>> http://localhost/URL, and .php files were not working the log says the
>>> following.
>>>
>>> #################
>>> Apr 28 07:43:01 2009] [notice] Apache/2.2.11 (Win32) configured --
>>> resuming
>>> normal operations
>>> [Tue Apr 28 07:43:01 2009] [notice] Server built: Dec 10 2008 00:10:06
>>> [Tue Apr 28 07:43:01 2009] [notice] Parent: Created child process 1296
>>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Child process is running
>>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Acquired the start mutex.
>>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting 64 worker
>>> threads.
>>> [Tue Apr 28 07:43:01 2009] [notice] Child 1296: Starting thread to listen
>>> on
>>> port 80.
>>> [Tue Apr 28 13:53:17 2009] [error] [client 192.168.1.104] File does not
>>> exist: C:/Program Files/Apache Software
>>> Foundation/Apache2.2/htdocs/crossdomain.xml
>>> [Tue Apr 28 14:47:45 2009] [error] [client 127.0.0.1] File does not
>>> exist:
>>> C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
>>> #####################################
>>>
>>> Can someone tell me what these two files are, what do they do, why are
>>> they
>>> important, and why no liteature mentions about them.
>>>
>>> Any help will be appreciated.
>>>
>>> nagrik.
>>>
>>> On Wed, Apr 29, 2009 at 4:32 AM, James Crow wrote:
>>>
>>>
>>>
>>>>
>>>>
>>> --
>>> Thanks
>>>
>>> Nagrik
>>>
>>>
>>>
>>
>> favicon.ico http://en.wikipedia.org/wiki/Favicon.ico
>> crossdomain.xml http://en.wikipedia.org/wiki/Cross-site_request_forgery
>>
>>
>>
> On windows you can check the status of a service by running:
>
> sc query apache2
>
> from a command prompt. The process name may be apache22. There is also the
> Services MSC SnapIn that can be opened from Control Panel->Administrative
> Tools->Services icon. It will list the status of all installed services.
>
> You seem to have two problems:
> 1) Apache serving up 404 errors vice web pages
> 2) PHP scripts not executing
>
> Fix Apache first before you worry about PHP. If there is an error in the
> php.ini file it can cause Apache not to start. The error.log file I
> mentioned earlier will show these types of errors though.
>
> Cheers,
> James
>



--
Thanks

Nagrik

--00163646ca445ff7340468b3bc4d--

Re: First PHP program not working

am 29.04.2009 19:01:28 von James Crow

Check the error.log file. It will tell you why the Apache service is not
starting.


Vinay Nagrik wrote:
> Hello Everybody,
>
> I checked my services and my find is
>
> Apache is installed and is suppsed to start in 'Automatic' mode following is
> the entry in the Services
>
> Name Description Status Startup
> Type LogOn As
> Apache Apache/2.2.11 (Win32) ------
> Automatic Local System
>
> However, the services does not start automatically, when I logon as an user
> or as an administrator.
>
> I tried starting 'Apache' manually by going into the installed software at
> the bottom of the taskbar. While logged on as a user, it forces me to start
> the service as an 'administrator', but then asks for the password. As far
> as password is concerned for the administrator for Apache, "I do not have
> any password" and it fails to start 'Apache'.
>
> When I log on as administrator, even then it does not start Apache. When I
> try to start Apache manually, it gives error message,
>
> "Requested services failed."
>
> I know I am missing one small point. And I know out there is somebody, who
> must have encountered the same problem.
>
> Please help.
>
> nagrik.
>
> On Wed, Apr 29, 2009 at 8:29 AM, James Crow wrote:
>
>


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php