473,756 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2397
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\Apac he2.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.comwro te:
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\Apac he2.2\htdocs) and typehttp://localhost/youfilename.php into 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.comwro te:
>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\Apac he2.2\htdocs) and typehttp://localhost/youfilename.php into 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 "DocumentRo ot" 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_d irectory"

Once you set up your "DocumentRo ot", 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.comwro te:
>>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\Apac he2.2\htdocs) and typehttp://localhost/youfilename.php into 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.org wrote:
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 "DocumentRo ot" 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_d irectory"

Once you set up your "DocumentRo ot", 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\php5a pache2_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.org wrote:
>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 "DocumentRo ot" 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_d irectory"

Once you set up your "DocumentRo ot", 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\php5a pache2_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*******@attgl obal.net
=============== ===
Feb 9 '07 #8
On Feb 8, 7:42 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.org wrote:
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 "DocumentRo ot" 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_d irectory"
Once you set up your "DocumentRo ot", 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\php5a pache2_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...@attgl obal.net
=============== ===
Not much to report. At this point Apache won't even start if I change
"httpd.conf " to add the "LoadModule_php 5" 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...@attg lobal.netwrote:
rfhurley wrote:
On Feb 6, 11:50 pm, Siegfreed <s...@freed.org wrote:
>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 "DocumentRo ot" 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_d irectory"
>Once you set up your "DocumentRo ot", 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\php5a pache2_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\php5a pache2_2_4.dll"
to
LoadModule php5_module "C:\Program Files\PHP\php5a pache2_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\ROB ERT~1\LOCALS~1\ Temp\WERa0cf.di r00\httpd.exe.m dmp
C:\DOCUME~1\ROB ERT~1\LOCALS~1\ Temp\WERa0cf.di r00\appcompat.t xt
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.n et. 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

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

Similar topics

0
1779
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 ? If I do /usr/sbin/apachectl extendedstatus command, I got this. =============================================================================== * * * Apache Server Status for noname.com
3
2313
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 Apache isn't processing the PHP pages! What's going on here? Somebody can help me ? If I do /usr/sbin/apachectl extendedstatus command, I got this. =============================================================================== * * *
2
14169
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 Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
9
7484
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 XP Pro PC and I then installed the full DirectX 9.0 SDK (Summer 2004) & then the latest DirectX 9.0 SDK (Feb 2005) Spent several hours doing all this but there are NO DirectX C# sample
76
4088
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 can contain lots of data. <Results> <Data>Stuff</Data> <Data>More stuff</Data>
0
2559
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 for directories is C:\Apache\Apache2\htdocs-root folder for Dreamweaver 6.0 otherwise know as MX 2004 I think. C:\mysql, C:\mysql\data-databases including phpmyadmin C:\php C:\Apache\Apache2\phpmyadmin for phpMyAdmin scripts.
2
2284
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
2226
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. http://blogs.msdn.com/toddca/archive/2005/12/01/499144.aspx I then tried a few of solution I found while perusing Google, - FCNMode registry mod - Relocating to App_Data folder to create/modify/delete directories.
3
12147
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, and apache all in 1 setup.. Ok.. from here.. I have a folder in my local drive appserv within it.. php, apache, mysql, and www. www holds everything in my index which is what i am directed to when i go to http://localhost Everything seems to be...
0
9456
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
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
9713
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
8713
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 project—planning, coding, testing, and deployment—without 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
7248
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
5142
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...
1
3805
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

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.