473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

loaded latest edition of Apache http server on XP, and installed php on that server...

How do I run a .php program? (I'm starting with the "hello world"
script)

Feb 6 '07 #1
18 2367
On Feb 6, 3:32 pm, "rfhurley" <rfhur...@yahoo.comwrote:
How do I run a .php program? (I'm starting with the "hello world"
script)
Well, put your .php file in the document root of the webserver (eg. c:
\Program Files\Apache Software Foundation\Apache2.2\htdocs) and type
http://localhost/youfilename.php into a web browser.

Feb 7 '07 #2
On Feb 6, 7:24 pm, "Benjamin" <musiccomposit...@gmail.comwrote:
On Feb 6, 3:32 pm, "rfhurley" <rfhur...@yahoo.comwrote:How do I run a .php program? (I'm starting with the "hello world"
script)

Well, put your .php file in the document root of the webserver (eg. c:
\Program Files\Apache Software Foundation\Apache2.2\htdocs) and typehttp://localhost/youfilename.phpinto a web browser.
Benjamin,
Thank you for responding. OK, I put the php doc in the correct folder,
where localhost is able to fid it, but it just reads out the code. Do
I have to configure the PHP in a certain way for the script to work?
btw, the script reads: "<?php phpinfo(); ?>" (quotation marks mine)

Feb 7 '07 #3
rfhurley wrote:
On Feb 6, 7:24 pm, "Benjamin" <musiccomposit...@gmail.comwrote:
>On Feb 6, 3:32 pm, "rfhurley" <rfhur...@yahoo.comwrote:How do I run a .php program? (I'm starting with the "hello world"
>>script)
Well, put your .php file in the document root of the webserver (eg. c:
\Program Files\Apache Software Foundation\Apache2.2\htdocs) and typehttp://localhost/youfilename.phpinto a web browser.

Benjamin,
Thank you for responding. OK, I put the php doc in the correct folder,
where localhost is able to fid it, but it just reads out the code. Do
I have to configure the PHP in a certain way for the script to work?
btw, the script reads: "<?php phpinfo(); ?>" (quotation marks mine)

sounds like you haven't told apache what to do with .php files.

Re read the installation details for php and what you need to put in the
hpptd.conf file to get Apache processing php files.

Regards

Justin
Feb 7 '07 #4
rfhurley wrote:
How do I run a .php program? (I'm starting with the "hello world"
script)
You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-

DocumentRoot "C:/my_chosen_php_directory"

Once you set up your "DocumentRoot", place the files you want to run in
there, and type:

http://localhost/your_file_name.php into a web browser; or
http://127.0.0.1/your_file_name.php into a web browser.
Feb 7 '07 #5
On Wed, 07 Feb 2007 20:29:51 +1300, Justin wrote:
rfhurley wrote:
>On Feb 6, 7:24 pm, "Benjamin" <musiccomposit...@gmail.comwrote:
>>On Feb 6, 3:32 pm, "rfhurley" <rfhur...@yahoo.comwrote:How do I run a .php program? (I'm starting with the "hello world"
script)
Well, put your .php file in the document root of the webserver (eg. c:
\Program Files\Apache Software Foundation\Apache2.2\htdocs) and typehttp://localhost/youfilename.phpinto a web browser.

Benjamin,
Thank you for responding. OK, I put the php doc in the correct folder,
where localhost is able to fid it, but it just reads out the code. Do
I have to configure the PHP in a certain way for the script to work?
btw, the script reads: "<?php phpinfo(); ?>" (quotation marks mine)


sounds like you haven't told apache what to do with .php files.

Re read the installation details for php and what you need to put in the
hpptd.conf file to get Apache processing php files.

Regards

Justin
You need to add php support to apache as well... pretty simple to do, but
specific to OS. The manual is pretty helpful at this point.

Feb 7 '07 #6
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
How do I run a .php program? (I'm starting with the "hello world"
script)

You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-

DocumentRoot "C:/my_chosen_php_directory"

Once you set up your "DocumentRoot", place the files you want to run in
there, and type:

http://localhost/your_file_name.phpinto a web browser; orhttp://127.0.0.1/your_file_name.phpinto a web browser.
OK, I went to the "httpd.conf" file, and added this:

# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"

and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).

I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?

Feb 8 '07 #7
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
>rfhurley wrote:
>>How do I run a .php program? (I'm starting with the "hello world"
script)
You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-

DocumentRoot "C:/my_chosen_php_directory"

Once you set up your "DocumentRoot", place the files you want to run in
there, and type:

http://localhost/your_file_name.phpinto a web browser; orhttp://127.0.0.1/your_file_name.phpinto a web browser.

OK, I went to the "httpd.conf" file, and added this:

# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"

and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).

I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?
What error message do you get?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 9 '07 #8
On Feb 8, 7:42 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
How do I run a .php program? (I'm starting with the "hello world"
script)
You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-
DocumentRoot "C:/my_chosen_php_directory"
Once you set up your "DocumentRoot", place the files you want to run in
there, and type:
>http://localhost/your_file_name.phpintoa web browser; orhttp://127.0.0.1/your_file_name.phpintoa web browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?

What error message do you get?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Not much to report. At this point Apache won't even start if I change
"httpd.conf" to add the "LoadModule_php5" code. Before, I had to plow
through a couple of levels of error message to even get to an
indecipherable explanation.
I try again, though, and see if I can get something.

Feb 9 '07 #9
On Feb 8, 7:53 pm, "rfhurley" <rfhur...@yahoo.comwrote:
On Feb 8, 7:42 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
>rfhurley wrote:
>>How do I run a .php program? (I'm starting with the "hello world"
>>script)
>You need to specify the document root (the directory that Apache will
>look for files when asked to serve them) in your "httpd" configuration
>file, which in turn is located in the "Conf" directory. The section
>that control the "DocumentRoot" look like this:-
># DocumentRoot: The directory out of which you will serve your
># documents. By default, all requests are taken from this directory, but
># symbolic links and aliases may be used to point to other locations.
># Example:-
>DocumentRoot "C:/my_chosen_php_directory"
>Once you set up your "DocumentRoot", place the files you want to run in
>there, and type:
>>http://localhost/your_file_name.phpintoaweb browser; orhttp://127.0.0.1/your_file_name.phpintoaweb browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?
What error message do you get?
Jerry,
I changed the line that read
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
to
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll"
(the line I used when I was still able to start apache)

and I was able to load apache again, but when I ran the "<?php
phpinfo(); ?>" script, the error messages came up again & shut apache
down. I was able to transcribe the highlights of dialog boxes #s 2 & 3
(dialog box 1 was that standard Windows box), which read:

Error signature

szAppName: httpd.exe szAppVer: 2.2.4.0 szMadName: unknown
szModVer: 0.0.0.0 offset: 01ed2dc0

To view technical info...click here:

which brings up another dialog box, which reads:
Error Report Contents

The following files will be included in this error report:

C:\DOCUME~1\ROBERT~1\LOCALS~1\Temp\WERa0cf.dir00\h ttpd.exe.mdmp
C:\DOCUME~1\ROBERT~1\LOCALS~1\Temp\WERa0cf.dir00\a ppcompat.txt
One other thing:

There's a section of httpd.conf which reads:

#
# ServerName gives the name and port that the server uses to identify
itself.
# This can often be determined automatically, but we recommend you
specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP
address here.
#
ServerName www.glassangel.com.com:80

glassangel is my domain, which is hosted on laughingsquid.net. I don't
know what the ServerName attribute would be named on my machine. Would
this have any effect on anything?

Feb 9 '07 #10
rfhurley wrote:
On Feb 8, 7:42 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>rfhurley wrote:
>>On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
How do I run a .php program? (I'm starting with the "hello world"
script)
You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-
DocumentRoot "C:/my_chosen_php_directory"
Once you set up your "DocumentRoot", place the files you want to run in
there, and type:
http://localhost/your_file_name.phpintoa web browser; orhttp://127.0.0.1/your_file_name.phpintoa web browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?
What error message do you get?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Not much to report. At this point Apache won't even start if I change
"httpd.conf" to add the "LoadModule_php5" code. Before, I had to plow
through a couple of levels of error message to even get to an
indecipherable explanation.
I try again, though, and see if I can get something.
You said you got an error message before. Do you remember what it was?

What do you get if you do a syntax check the Apache configuration file?
Use the -t parameter to the startup command.

And what's in your Apache error log?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 9 '07 #11
On Feb 8, 8:43 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
rfhurley wrote:
On Feb 8, 7:42 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
How do I run a .php program? (I'm starting with the "hello world"
script)
You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-
DocumentRoot "C:/my_chosen_php_directory"
Once you set up your "DocumentRoot", place the files you want to run in
there, and type:
http://localhost/your_file_name.phpintoaweb browser; orhttp://127.0.0.1/your_file_name.phpintoaweb browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?
What error message do you get?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Not much to report. At this point Apache won't even start if I change
"httpd.conf" to add the "LoadModule_php5" code. Before, I had to plow
through a couple of levels of error message to even get to an
indecipherable explanation.
I try again, though, and see if I can get something.

You said you got an error message before. Do you remember what it was?

What do you get if you do a syntax check the Apache configuration file?
Use the -t parameter to the startup command.

And what's in your Apache error log?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
I sent an email to your email address to enquire whether I could send
you some files to look at. Also, how do you use the -t parameter on
Windows? (it looks like a UNIX flag, which I'm not really fluent with
either...)

R

Feb 9 '07 #12
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
>>rfhurley wrote:
>>>How do I run a .php program? (I'm starting with the "hello world"
script)

You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-

DocumentRoot "C:/my_chosen_php_directory"

Once you set up your "DocumentRoot", place the files you want to run in
there, and type:

http://localhost/your_file_name.phpinto a web browser; orhttp://127.0.0.1/your_file_name.phpinto a web browser.


OK, I went to the "httpd.conf" file, and added this:

# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"

and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).

I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?
Problably the module you are using is not compatible with Apache.

In my machine I have php version 6 and apache version 2.2 - consequently
I use:

"LoadModule php5_module c:/programs/php/php6apache2_2.dll".

Please note:- Unlike you, I use forward slashes.

It works like a clock.

Feb 9 '07 #13
On Feb 8, 9:46 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
>rfhurley wrote:
>>How do I run a .php program? (I'm starting with the "hello world"
script)
>You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-
># DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-
>DocumentRoot "C:/my_chosen_php_directory"
>Once you set up your "DocumentRoot", place the files you want to run in
there, and type:
>http://localhost/your_file_name.phpintoa web browser; orhttp://127.0.0.1/your_file_name.phpintoa web browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?

Problably the module you are using is not compatible with Apache.

In my machine I have php version 6 and apache version 2.2 - consequently
I use:

"LoadModule php5_module c:/programs/php/php6apache2_2.dll".

Please note:- Unlike you, I use forward slashes.

It works like a clock.
Do you run Windows XP? I noticed you wrote "c:programs/..." rather
than "c:/Program Files/..." should I try this?

Feb 9 '07 #14
On Feb 8, 9:46 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
>rfhurley wrote:
>>How do I run a .php program? (I'm starting with the "hello world"
script)
>You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-
># DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-
>DocumentRoot "C:/my_chosen_php_directory"
>Once you set up your "DocumentRoot", place the files you want to run in
there, and type:
>http://localhost/your_file_name.phpintoa web browser; orhttp://127.0.0.1/your_file_name.phpintoa web browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?

Problably the module you are using is not compatible with Apache.

In my machine I have php version 6 and apache version 2.2 - consequently
I use:

"LoadModule php5_module c:/programs/php/php6apache2_2.dll".

Please note:- Unlike you, I use forward slashes.

It works like a clock.
btw... I tried forward slashes too. the results were identical

Feb 9 '07 #15
go to...

http://web.torres.ws/walters_way

I have a complete set of docs on how to install and configure:

* Apache (with virtual hosts)
* mySQL
* Perl (with MODperl)
* PHP (with PEAR)
* Python
* SSH2
* CVS (with SSH keys)
* GPG

It might help you in the long run

Walter

Feb 9 '07 #16
rfhurley wrote:
On Feb 8, 7:53 pm, "rfhurley" <rfhur...@yahoo.comwrote:
>On Feb 8, 7:42 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.orgwrote:
rfhurley wrote:
>How do I run a .php program? (I'm starting with the "hello world"
>script)
You need to specify the document root (the directory that Apache will
look for files when asked to serve them) in your "httpd" configuration
file, which in turn is located in the "Conf" directory. The section
that control the "DocumentRoot" look like this:-
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Example:-
DocumentRoot "C:/my_chosen_php_directory"
Once you set up your "DocumentRoot", place the files you want to run in
there, and type:
http://localhost/your_file_name.phpintoaweb browser; orhttp://127.0.0.1/your_file_name.phpintoaweb browser.
OK, I went to the "httpd.conf" file, and added this:
# For PHP 5 do something like this:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:\Program Files\PHP"
and then ran the "<?php phpinfo(); ?>" script. It ran (correctly) in
my browser, but then an error message came up, shutting down apache. I
turned apache back on; the same thing happened again-- but this time,
when I tried to turn it back on, an error message came up, telling me
the operation couldn't be performed (wouldn't run apache). I restarted
my computer; Apache wouldn't start again (same error message).
I removed the added lines from the "httpd.conf" file, and restarted
everything. Everything ran fine; but when I re-added the "LoadModule
php5_module..." code, it wouldn't start apache. What's going on? And
what do I do now?
What error message do you get?

Jerry,
I changed the line that read
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2_4.dll"
to
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll"
(the line I used when I was still able to start apache)

and I was able to load apache again, but when I ran the "<?php
phpinfo(); ?>" script, the error messages came up again & shut apache
down. I was able to transcribe the highlights of dialog boxes #s 2 & 3
(dialog box 1 was that standard Windows box), which read:

Error signature

szAppName: httpd.exe szAppVer: 2.2.4.0 szMadName: unknown
szModVer: 0.0.0.0 offset: 01ed2dc0

To view technical info...click here:

which brings up another dialog box, which reads:
Error Report Contents

The following files will be included in this error report:

C:\DOCUME~1\ROBERT~1\LOCALS~1\Temp\WERa0cf.dir00\h ttpd.exe.mdmp
C:\DOCUME~1\ROBERT~1\LOCALS~1\Temp\WERa0cf.dir00\a ppcompat.txt
One other thing:

There's a section of httpd.conf which reads:

#
# ServerName gives the name and port that the server uses to identify
itself.
# This can often be determined automatically, but we recommend you
specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP
address here.
#
ServerName www.glassangel.com.com:80

glassangel is my domain, which is hosted on laughingsquid.net. I don't
know what the ServerName attribute would be named on my machine. Would
this have any effect on anything?

The server name is just the name Apache responds to in the HTTP header.
It needs to be your domain name at your host; for your local test it
can be almost anything. It's not going to affect this problem.

I suspect you have a conflict between extensions. That is, you are
trying to load two different versions of the module. For instance, PHP
has a version of MySQL compiled in its extension. If you have another
extension which has compiled a different version of MySQL, you will have
a problem.

We already know PHP is one of the problems. I suggest you take out all
other extensions and add them back one at a time until you get the error
again. Or, alternatively, remove the extensions one at a time until
it starts working.

And BTW (from another message) I don't take files, etc. by email. Leave
it in the newsgroup so everyone can benefit. If anyone wants to do
things privately it's billable at my normal rates :-).

You might also think about the Apache Users mailing list at
www.apache.org. That's where the Apache experts are found, and know
more about the internals.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 9 '07 #17
On Feb 9, 12:03 am, otrWal...@gmail.com wrote:
go to...

http://web.torres.ws/walters_way

I have a complete set of docs on how to install and configure:

* Apache (with virtual hosts)
* mySQL
* Perl (with MODperl)
* PHP (with PEAR)
* Python
* SSH2
* CVS (with SSH keys)
* GPG

It might help you in the long run

Walter
Thank you. I will check into this. I'm completely new to running a
server, so there might be (a lot) more questions coming.

Rob

Feb 9 '07 #18
On Feb 6, 1:32 pm, "rfhurley" <rfhur...@yahoo.comwrote:
How do I run a .php program? (I'm starting with the "hello world"
script)
Thank you to everyone who posted here! I received a suggestion (on
apache forum) to try out apachefriends.org. They have an all-you-can-
eat (PHP/Pear, Perl, MySQL, etc.) Apache distro called XAMPP, which I
was told was easy to use. So I downloaded it and, lo & behold, it
WORKED! Right out of the box. I recommend this distribution highly for
those cognitively-impaired newbies such as myself. For the time being
I just want to test out my Perl & PHP scripts on a server. When I want
to get into the nuts 'n' bolts of serverdom, I'll probable be using a
Linux distribution for the operating system.

Again, thanks to all those who made suggestions! I greatly appreciate
the help.

Feb 9 '07 #19

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

Similar topics

0
by: Jean-Louis Vill | last post by:
=============================================================================== I installed PHP from an RPM, but Apache isn't processing the PHP pages! What's going on here? Somebody can help me ?...
3
by: Jean-Louis Vill | last post by:
I did a mistake with the files name (http.conf ==> httpd.conf). See at the end. =============================================================================== I installed PHP from an RPM, but...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
9
by: Mike P | last post by:
Problems, problems... Im trying to create DirectX Projects within C# and to also look at the latest DirectX C# Samples. I have just installed MS Visual C# .net Standard Edition on my Windows...
76
by: kwilder | last post by:
This works, but it doesn't load the latest version of the xml if it was just modified without closing and reopening the browser. Here's the scenario: I have an xml doc called results.xml. It...
0
by: Howard | last post by:
I have Apache Web Server 2.0.55 installed locally with MySQL 5.0.18-nt, and of course PHP 5.1.2 I also have installed phpMyAdmin. It is accessible through http://localhost/phpMyAdmin. The pathing...
2
by: Peter Stojkovic | last post by:
I am using Visual Studio 2005 with the above Build. Is this the latest Version ??? Thanks Peter Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200)
5
by: Tony | last post by:
Hi all, Here's the link to the issue we were seeing on our ASP.NET system when modifying, adding and deleting directories in framework 2.0....
3
by: Sidu | last post by:
Ok well i'm still very new to apache, mysql, and php.. let me explain everything i have set up.. I have installed Appserv, for those of you who are unfamiliar with it.. it installs mysql, php,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.