473,406 Members | 2,369 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,406 software developers and data experts.

Apache 2.0.54, Windows 2k, and php5.0.5 - do the work together

I'm a php newbie. I have installed apache 2.0.54 and php 5.0.5 on my
win2k box. However, it does not appear the php is working properly. I
base this on the following code(which I got from a book):

<html>
<head>
<title>Listing Server Variables</title>
</head>
<body>
<h2>PHP and HTML</h2>
<P>Server Variables</P>
<?php
$envs = array ("HTTP_REFERER", "HTTP_USER_AGENT", "REMOTE_ADDR",
"REMOTE_HOST", "QUERY_STRING", "PATH_INFO");
foreach ($envs as $env)
print "$env: $GLOBALS[$env]<br>";
?>
</body>
</html>

All I get when I access via: http://localhost/phptest1.html is:

PHP and HTML

Server Variables
"; ?>

So, my first question is "Do these versions of software play well
together?" If so, where do I look first? I have added the following
lines to httpd.conf:

LoadModule php5_module "C:/php5/php5apache2.dll"
PHPIniDir "C:/php5"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

I took the php.ini.recommended, changed the name to php.ini, then
changed doc_root as follows:

doc_root = "C:\Program Files\Apache Group\Apache2\htdocs"

If these versions will play together, then what have I overlooked in
the install? Any help, comments, suggestions, are welcome.

Bill W

Sep 11 '05 #1
15 2620
May be a stupid question, but did you restart apache after installing
PHP? And did you put php.ini in C:\windows or winnt or whatever your
windows path is?

Sep 11 '05 #2
On 10 Sep 2005 21:32:19 -0700, IW****@gmail.com wrote:
May be a stupid question, but did you restart apache after installing
PHP? And did you put php.ini in C:\windows or winnt or whatever your
windows path is?


And what pray are you replying to?

Learn to quote!
Sep 11 '05 #3
On 10 Sep 2005 20:33:37 -0700, we*******@charter.net wrote:
All I get when I access via: http://localhost/phptest1.html is:

PHP and HTML

Server Variables
"; ?>


That's probably because you've saved the file as .HTM or .HTML, save it as
php and it will work fine.
Sep 11 '05 #4
changed to .php and accessed via http://localhost/phptest1.php and now
I get the following:

PHP and HTML

Server Variables
HTTP_REFERER:
HTTP_USER_AGENT:
REMOTE_ADDR:
REMOTE_HOST:
QUERY_STRING:
PATH_INFO:

BUT shouldn't I be seeing some values here? Do I have php/apache
configured properly (see original post)?

Bill W

Sep 11 '05 #5
On 11 Sep 2005 10:26:55 -0700, we*******@charter.net wrote:
changed to .php and accessed via http://localhost/phptest1.php and now
I get the following:

PHP and HTML

Server Variables
HTTP_REFERER:
HTTP_USER_AGENT:
REMOTE_ADDR:
REMOTE_HOST:
QUERY_STRING:
PATH_INFO:

BUT shouldn't I be seeing some values here? Do I have php/apache
configured properly (see original post)?

Bill W


Your getting the same as me! and I'm using the same configuration.

Have you tried the basic ..

<?php

phpinfo();

?>

This should list everything you need, if it doesn't then you may have
problems, but if the previous script threw up the same as my working
machine, then I would guess that yours is working fine.

If you want info on the global variables on your system the run this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta name="Generator" content="TextPad 4.7">
<meta name="Author" content="Barry Ambrose">
<meta name="Keywords" content="?">
<meta name="Description" content="?">
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Global Variables</title>
<style type="text/css">
body{background-color: #fff}
font-size: .8em;
font-family: arial serif;
</style>
</head>
<body>
<table width="100%" border="1">
<tr><td colspan="2"><h1>Displaying Predefined Variables</h1></td>
</tr>
<tr><td width="40%" valign="top">Globals - $GLOBALS</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r($GLOBALS);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Server - $_SERVER</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r($_SERVER);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">
Get - $_GET</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r($_GET);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Post - $_POST</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Cookie - $_COOKIE</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r ($_COOKIE) ;
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Files - $_FILES</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r ($_FILES);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Environment - $_ENV</td>
<td width="60%>
<?php
echo "<pre>";
print_r($_ENV);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Request - $_REQUEST</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r($_REQUEST);
echo "</pre>";
?>
</td>
</tr>
<tr><td width="40%" valign="top">Session - $_SESSION</td>
<td width="60%"><pre>
<?php
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
?>
</td>
</tr>
</table>
</body>
</html>

But this will only give you much the same info as the first script.
Sep 11 '05 #6
On 11 Sep 2005 10:26:55 -0700, we*******@charter.net wrote:
changed to .php and accessed via http://localhost/phptest1.php and now
I get the following:

PHP and HTML

Server Variables
HTTP_REFERER:
HTTP_USER_AGENT:
REMOTE_ADDR:
REMOTE_HOST:
QUERY_STRING:
PATH_INFO:

BUT shouldn't I be seeing some values here? Do I have php/apache
configured properly (see original post)?

Bill W


Of course if you upload to a webserver and run it you will get different
results.
Sep 11 '05 #7
On 10 Sep 2005 20:33:37 -0700, "we*******@charter.net" <we*******@charter.net>
wrote:
I'm a php newbie. I have installed apache 2.0.54 and php 5.0.5 on my
win2k box. However, it does not appear the php is working properly. I
base this on the following code(which I got from a book):
The book is apparently quite old.
<?php
$envs = array ("HTTP_REFERER", "HTTP_USER_AGENT", "REMOTE_ADDR",
"REMOTE_HOST", "QUERY_STRING", "PATH_INFO");
foreach ($envs as $env)
print "$env: $GLOBALS[$env]<br>";


None of the above are set as globals in the default and recommended
configuration of PHP since PHP 4.2.0.

You (correctly) have register_globals disabled. See the manual for more
details.

The content you're after will be available from the $_SERVER array.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 11 '05 #8
In article <0m********************************@4ax.com>,
Andy Hassall <an**@andyh.co.uk> wrote:
On 10 Sep 2005 20:33:37 -0700, "we*******@charter.net" <we*******@charter.net>
wrote:
I'm a php newbie. I have installed apache 2.0.54 and php 5.0.5 on my
win2k box. However, it does not appear the php is working properly. I
base this on the following code(which I got from a book):


The book is apparently quite old.
<?php
$envs = array ("HTTP_REFERER", "HTTP_USER_AGENT", "REMOTE_ADDR",
"REMOTE_HOST", "QUERY_STRING", "PATH_INFO");
foreach ($envs as $env)
print "$env: $GLOBALS[$env]<br>";


None of the above are set as globals in the default and recommended
configuration of PHP since PHP 4.2.0.

You (correctly) have register_globals disabled. See the manual for more
details.

The content you're after will be available from the $_SERVER array.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


Make a fiel, call it test.php.

cut 'n paste this into it

__________________

<?php

phpinfo();

?>

___________________

load the fiel from your server root with your browser.

If it gives you a bunch of info then your setup is working.

If not, then it is not.
Happy Trails
Claude
Sep 11 '05 #9
the phpinfo() did the trick....I get all sorts of info so I guess it is
working. Yes, the book is old. "Teach yourself PHP in 24hrs",
copyright 2002. Got it for less than a dollar at a garage sale....

Ok....so it looks like I do indeed have everything configured
correctly. Thanks for the info.

Bill W

Sep 12 '05 #10
In article <11*********************@g44g2000cwa.googlegroups. com>,
we*******@charter.net <we*******@charter.net> wrote:
the phpinfo() did the trick....I get all sorts of info so I guess it is
working. Yes, the book is old. "Teach yourself PHP in 24hrs",
copyright 2002. Got it for less than a dollar at a garage sale....

Ok....so it looks like I do indeed have everything configured
correctly. Thanks for the info.

Bill W


Cool

There is much more up-to-date info on the net...

Claude
Sep 12 '05 #11
I have Win2k, Apache, and PHP and the localhost is set up for IIS at
port 80. I had to set up Apache on port 8080.

No IIS on the machine?
On 10 Sep 2005 20:33:37 -0700, "we*******@charter.net"
<we*******@charter.net> wrote:
I'm a php newbie. I have installed apache 2.0.54 and php 5.0.5 on my
win2k box. However, it does not appear the php is working properly. I
base this on the following code(which I got from a book):
All I get when I access via: http://localhost/phptest1.html is:


Sep 12 '05 #12

Obvious wrote:
On 10 Sep 2005 21:32:19 -0700, IW****@gmail.com wrote:
May be a stupid question, but did you restart apache after installing
PHP? And did you put php.ini in C:\windows or winnt or whatever your
windows path is?


And what pray are you replying to?

Learn to quote!


The topic creator? I though it was "obvious" (pun completly intended).
I'm on Google Groups, so maybe it's not as apparent to you guys or
something.

iw****@gmail.com

Sep 12 '05 #13
<IW****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

Obvious wrote:
On 10 Sep 2005 21:32:19 -0700, IW****@gmail.com wrote:
May be a stupid question, but did you restart apache after installing
PHP? And did you put php.ini in C:\windows or winnt or whatever your
windows path is?


And what pray are you replying to?

Learn to quote!


The topic creator? I though it was "obvious" (pun completly intended).
I'm on Google Groups, so maybe it's not as apparent to you guys or
something.


Learn to use the quoting features of Google Groups! It is customary to quote
enough of the post to which you are responding for readers to be able to
understand the context of your response.

--
Bill Segraves
Sep 13 '05 #14
I don't understand. Somebody asked a question. I posted the first
reply. Who else could I be responding to? Which part is confusing?

Bill Segraves wrote:
<IW****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

Obvious wrote:
On 10 Sep 2005 21:32:19 -0700, IW****@gmail.com wrote:

> May be a stupid question, but did you restart apache after installing
> PHP? And did you put php.ini in C:\windows or winnt or whatever your
> windows path is?

And what pray are you replying to?

Learn to quote!


The topic creator? I though it was "obvious" (pun completly intended).
I'm on Google Groups, so maybe it's not as apparent to you guys or
something.


Learn to use the quoting features of Google Groups! It is customary to quote
enough of the post to which you are responding for readers to be able to
understand the context of your response.

--
Bill Segraves


Sep 13 '05 #15
<IW****@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
I don't understand.
It appears to be so. ;-)
Somebody asked a question. I posted the first
reply. Who else could I be responding to?
You were responding to thousands of readers of the Usenet newsgroup
comp.lang.php, with utter disregard for Usenet ettiquette. You have no right
to waste the time of all of these good people by disregarding the rules of
behavior.
Which part is confusing?

The part where you don't yet understand the customs of Usenet. We hope you
learn to conform before you are killfiled by many Usenet contributors who
could be valuable resources for you.

Also, you should not top-post, a.k.a. jeopardy post. Long-standing Usenet
custom is to intersperse your comments with the key points to which you are
responding, e.g.,
Q1. skugfh
A1. sDKf
Q2. ;lkhjaga


A2.

Finally, while you seem to have picked up on the suggestion that you use
your Google Groups setup to quote correctly, you missed the mark because you
top-posted, showing disrespect for everyone that reads your post.

Cheers.
--
Bill Segraves

<extraneous content snipped>
Sep 13 '05 #16

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

Similar topics

0
by: John Murtari | last post by:
Folks, We have been running PHP 4.x on Apache 1.3.x with no problems. After the first upgrade from php3 -> php4 were were able to load both modules for php 3 and php 4 with no problem. With an...
2
by: John Murtari | last post by:
Folks, I work for a web provider and we would really like to start allowing people to experiment with php 5 on their websites without forcing an overall upgrade and potential code problems. ...
0
by: Dave Pham | last post by:
I just cleaned my comp, and I am trying to re-config my webserver... I am trying to setup apache 2 so it runs both php4 and php5, I also have two instances of mysql running. I know this can be...
2
by: John Murtari | last post by:
Folks, We are slow in rolling out PHP 5 to our users because it won't live as a module with PHP 4 in Apache 1.3.x/Linux. I have seen many workaround like running it as CGI or using a reverse...
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...
1
by: Nospam | last post by:
I am trying to get mysql 4, php5, and apache to work on my winxp sp2 comp, unfortunately even though php5 and apache seems to work ok I am unable to utilise mysql with php and apache, I have yet to...
3
by: genenamg | last post by:
Hi, I am trying to run and configure Apache 2.0, php 5 and mysql on win xp professional - this is the first time I have tried to install and configure all three. I am having difficulty trying...
6
by: Bruce A. Julseth | last post by:
Okay. I'm still can't get Apache to restart after changing the httpd config file. I've upgraded my installation to 5.2. Apache 2.2.3 runs fine without any PHP additions. 1) I added my PHP...
5
by: john | last post by:
All: Very experienced developer, newbie to PHP. My situation: I have installed on my WIndows XP machine the following: * PHP 5.2.1 * MySQL 5.0 * Apache 2.2 All of these are installed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
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...
0
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...
0
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,...
0
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...

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.