By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,836 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,836 IT Pros & Developers. It's quick & easy.

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

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

Feb 6 '07 #1
Share this Question
Share on Google+
18 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.