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

Problem installing PHP5 on WinXP and Apache2

I'm having trouble getting PHP installed on my system. I downloaded
the zip file and extracted the files to C:\php. Following the
documentation, I did the following

- added C:\php to my PATH
- added the following lines to the httpd.conf file for Apache

# Adding module references for PHP
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php/"

I tried it both with and without the last slash on the PHPIniDir, made
no difference.

- I copied and renamed php.ini-recommended as php.ini.
- One bit of advice in the documentation said to copy this file to "the
apache directory", which is a bit vauge. There's lots of Apache
directories. I tried it in both Apache2 and htdocs, no difference.

It does not seem to be processing PHP commands at all. The sample I'm
using is

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo 'Hello World'; ?>
</body>
</html>

If I bring up the page and View Source, this is exactly what I get.
Its my understanding that if PHP were working correctly I'd just see
the Hello World, and not the surrounding PHP script.

Also, I checked my Apache logs, nothing relevent within. Anyone know
what I might have missed?

Thanks!

Oct 19 '05 #1
8 1631
Ma*******@gmail.com wrote:
I'm having trouble getting PHP installed on my system. I downloaded
the zip file and extracted the files to C:\php. Following the
documentation, I did the following

- added C:\php to my PATH
- added the following lines to the httpd.conf file for Apache

# Adding module references for PHP
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php/"

I tried it both with and without the last slash on the PHPIniDir, made
no difference.

- I copied and renamed php.ini-recommended as php.ini.
- One bit of advice in the documentation said to copy this file to "the
apache directory", which is a bit vauge. There's lots of Apache
directories. I tried it in both Apache2 and htdocs, no difference.

It does not seem to be processing PHP commands at all. The sample I'm
using is

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo 'Hello World'; ?>
</body>
</html>

If I bring up the page and View Source, this is exactly what I get.
Its my understanding that if PHP were working correctly I'd just see
the Hello World, and not the surrounding PHP script.

Also, I checked my Apache logs, nothing relevent within. Anyone know
what I might have missed?

Thanks!

Two things:
1. I think PHPIniDir may need to be "C:\php"
2. Did you restart apache? It needs to be restarted to pick up changes
in the httpd.conf.

-david-

Oct 19 '05 #2
David Haynes wrote:
Ma*******@gmail.com wrote:
I'm having trouble getting PHP installed on my system. I downloaded
the zip file and extracted the files to C:\php. Following the
documentation, I did the following

- added C:\php to my PATH
- added the following lines to the httpd.conf file for Apache

# Adding module references for PHP
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php/"

I tried it both with and without the last slash on the PHPIniDir,
made no difference.

- I copied and renamed php.ini-recommended as php.ini.
- One bit of advice in the documentation said to copy this file to
"the apache directory", which is a bit vauge. There's lots of
Apache directories. I tried it in both Apache2 and htdocs, no
difference.

It does not seem to be processing PHP commands at all. The sample
I'm using is

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo 'Hello World'; ?>
</body>
</html>

If I bring up the page and View Source, this is exactly what I get.
Its my understanding that if PHP were working correctly I'd just see
the Hello World, and not the surrounding PHP script.

Also, I checked my Apache logs, nothing relevent within. Anyone
know what I might have missed?

Thanks!

Two things:
1. I think PHPIniDir may need to be "C:\php"
2. Did you restart apache? It needs to be restarted to pick up
changes in the httpd.conf.

-david-


Also restart the computer as sometimes the path variable doesn't "set"
right.

--

Oct 19 '05 #3
Like I said, I've tried it with and without the slash. I've restarted
apache, and restarted the computer. I've confirmed that PHP does work
by invoking it from the command line - confirmed that the PATH is set
correctly as well. So the problem has to be in Apache.

Apache works fine, it has been up and running for quite some time. I
added the lines above to the end of the file. Do they need to be in a
certain place in the file?

If it would help, I have a very simple script set up on my server.

http://maddman.damnserver.com/test/

If anyone has any ideas what the problem could be, I'd be very
grateful. I could post my httpd.conf if that would help.

Oct 20 '05 #4
>
If it would help, I have a very simple script set up on my server.

http://maddman.damnserver.com/test/


Does it work if you give that file a .php extension (i.e. test.php)?

http://uk2.php.net/manual/en/install.windows.php

is a good source of tips, especially the user comments with links to other
articles.
Oct 20 '05 #5
> I'm having trouble getting PHP installed on my system.

I know it's troublesome when the correct php.ini or the required
php*.dll files are NOT in proper place. Tell us what's your phpinfo()
file says?

Before loosing all your hairs, you might try a simpler solution. Get
the zip file for xampp package and extract that to a root drive ...
i.e. in d: or e:. Then run that xamppstart.bat file.

And you are ready to run! Should you hate these solution, just delete
that e:\xampp folder! No registry were hurt during installing this
system ;)

http://www.apachefriends.org/en/

--
Raqueeb Hassan
Bangladesh

Oct 20 '05 #6
Ma*******@gmail.com wrote:
Like I said, I've tried it with and without the slash. I've restarted
apache, and restarted the computer. I've confirmed that PHP does work
by invoking it from the command line - confirmed that the PATH is set
correctly as well. So the problem has to be in Apache.

Apache works fine, it has been up and running for quite some time. I
added the lines above to the end of the file. Do they need to be in a
certain place in the file?

If it would help, I have a very simple script set up on my server.

http://maddman.damnserver.com/test/

If anyone has any ideas what the problem could be, I'd be very
grateful. I could post my httpd.conf if that would help.


Rename your 'index.html' file to 'index.php'.

Carl.
Oct 20 '05 #7
That did the trick! It works fine as index.php. I was under the
impression that any <?php...> in an html file would be treated as a
script - is this not the case? Do I need to make every file with a
script a .php? I need to do some reading it seems.

Thanks!

Oct 20 '05 #8
>That did the trick! It works fine as index.php. I was under the
impression that any <?php...> in an html file would be treated as a
script - is this not the case?
No. And you can bet that the string '<?php' occurs not infrequently
in image and audio files, too.
Do I need to make every file with a
script a .php? I need to do some reading it seems.


You need to identify every PHP script as a php script with
MIME type application/x-httpd-php. This is often done
with a directive in the Apache config file like:
AddType application/x-httpd-php .php
You could to this to the file extension .php3, or .txt, or .html,
or .gif if you want. (In the case of .gif, that's pretty nasty,
and in the case of .html, it means all pure html files will be
processed by PHP, which is a bit of overhead but probably not too
bad.) The AddType directive can also be used in .htaccess files
on a per-directory basis.

Gordon L. Burditt
Oct 20 '05 #9

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

Similar topics

0
by: michael newport | last post by:
I did the following as instructed in the docs. (see below) everything seemed to install ok and I started apache with no complaints, but, 1)I do not see a process for apache using ps -ef 2) In...
1
by: FL | last post by:
Hi, I'm tring to *test* php5 beta2 as module with Apache 2.0.48 and win2k (I know, I'm nuts :o) First, there is no php5apache2.dll in the beta2 package but a php4apache2.dll (php.net doc...
6
by: somaBoy MX | last post by:
I'm configuring PHP5 on my WinXP pro machine as an Apache2 handler. However when I start apache I get system errormessages like "PHP Shutdown: Unable to load dynamic library...
4
by: badbetty | last post by:
Dear Googlers I have installed PHP5 to run on WinXP against Apache 2. It works! ie. I have tested a few simple scripts and a basic xml document parse. I now want to try the XSL extension so I...
2
by: Stephen Harris | last post by:
I downloaded: Windows Binaries PHP 5.0.4 zip package - 31 Mar 2005 md5: fff10991a8e6f3b36ee567eb236ae3f4 This is the current BETA release of version 5.0 of the MySQL database server....
6
by: hannu | last post by:
Hello all good PHP people I have a really frustrating problem with php5.1.2+apache2 on OpenSuse 10.1 (X86-64) environment. Though I set the upload_max_filesize setting in php.ini file to any...
9
usafshah
by: usafshah | last post by:
Hi guys I'm using fedora core 6, php5 and apache2, i downloaded gd2 compiled and test with gddemo and its working fine... php is located: /usr/local/php gd is located: /usr/local/gd ...
3
by: Mamba | last post by:
hello to everyone, I'm using Mantis bug tracking system on Ubuntu Server with apache2, mysql 5.1 and php5. Mantis uses jpgraph for graphics but when I call a graphic page, Jpgraph return this...
1
by: Gilles Ganault | last post by:
Hello I'd like to play with MemcacheD and see how it improves read access to data, but I'm a bit lost at how to get from a working Apache2 + PHP5 + MySQL5 server on FreeBSD 6.3. I've never...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.