homepage Welcome to WebmasterWorld Guest from 50.17.107.233
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Installing PHP5 Under Windows XP and Apache
Brett_Tabke




msg:1253552
 7:13 pm on Jul 22, 2004 (gmt 0)

Anyone have a easy-cheesy install checklist?

(the install instructions that are in php are confusing and a mix of 95/98/2000/nt iis/xtami/etal instructions)...

I have installed it in the past and can do it again, but there are so many gotchas that I thought someone had a nice tutorial...

 

coopster




msg:1253553
 12:27 pm on Jul 25, 2004 (gmt 0)

Running as a server module

  1. Download [php.net] PHP5 for Windows (binary zip pkg)
  2. Extract the distribution file to a directory of your choice (C:\php).
  3. If you are using any php extension dlls then you will need those as well. To make sure that the dlls can be found, you can either copy them to the system directory (e.g. winnt/system32 or windows/system) or you can make sure that they live in the same directory as the main php executable or dll your web server will use (e.g. php.exe, php5apache.dll). The latter is much easier. If I am going to use any extensions, I typically copy them from the C:\php\ext folder to the C:\phpfolder that was created in step 2.


    Note: There have only been two files that have given me fits in the past, and they deal with the GD Library extension for images. I'm not sure if this has been fixed in PHP5 as I have not tested it yet. Go ahead and try using image functions after copying the related dlls from the
    C:\php\ext folder to the C:\phpfolder that was created in step 2. If you have difficulties, copy libeay32.dll and ssleay32.dll to the Windows root directory (C:\WINDOWS as instructed in the Image functions [php.net] pages of the PHP manual.


  4. Copy the php.ini-dist file from the C:\php folder to your C:\WINDOWS directory and rename it php.ini.
  5. Edit your php.ini file. This is where you are going to personalize your PHP installation. I am only including what I might call "bare minimum" changes here. First, let's search through the php.ini file for these directives and update them accordingly. Note, if your paths and/or filenames are different, update accordingly:


    doc_root = "C:\Program Files\Apache Group\Apache2\htdocs"
    extension_dir = "c:\php\"
    ; created my own directory so I can
    ; manage cleanup of temporary session files:
    session.save_path = "C:\Program Files\Apache Group\Apache2\htdocs\tmp"


  6. Uncomment any extensions you are going to use. For example:


    extension=php_curl.dll
    extension=php_gd2.dll
    extension=php_mysql.dll


  7. I'll give the mail() functions a separate bullet since it can be such a troublesome setting for folks. Probably easiest just to have a look at the directives and my comments...


    [mail function]
    ; For Win32 only.
    ; This can be used if you are running the
    ; Windows SMTP service (see IIS):
    ;SMTP = localhost
    ; Otherwise, use the external server for
    ; now (Note: Change to yours!):
    SMTP = mail.myserver.com
    ;
    ; For Win32 only. (Note: Change to yours!):
    sendmail_from = me@myserver.com
    ;
    ; For Unix only. You may supply arguments
    ; as well (default: "sendmail -t -i").
    ;sendmail_path =
    ;
    ; Force the addition of the specified parameters
    ; to be passed as extra parameters
    ; to the sendmail binary. These parameters will
    ; always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_paramaters =

Lastly, you may want to keep a hosts file (no extension, just the five letters, h-o-s-t-s) in C:\WINDOWS\system32\drivers\etc with the following entry:


127.0.0.1 localhost

Oh yeah, don't forget to update your Apache configuration to process PHP files.
Anyone care to contribute more...?

coopster




msg:1253554
 3:58 pm on Aug 5, 2004 (gmt 0)

I updated my WAMP setup from PHP5 RC1 earlier this week to PHP 5.0.0. At the same time I updated Apache from 2.0.48 to 2.0.50. In doing so I have run into an issue running PHP5 under Windows XP and Apache. I was receiving the following error message...

The image "http://localhost/example.jpg" cannot be displayed, because it contains errors.

Fun one to troubleshoot, no doubt. I did find resolution though, related information from both MS and Apache. To fix, I simply uncommented the following directives in my httpd.conf file:

EnableSendfile Off 
EnableMMAP Off
You may or may not have to disable use of AcceptEx(), so you might want to add that to your httpd.conf if necessary (see link in quotation below).


#
# EnableMMAP: Control whether memory-mapping is used to deliver
# files (assuming that the underlying OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems. On some systems, turning it off (regardless of
# filesystem) can improve performance; for details, please see
# [httpd.apache.org...]
#
EnableMMAP Off

# Also added this one as per Apache directions
# [apache.org...]
# ..but commented it out as it did not make any difference.
#Win32DisableAcceptEx

#
# EnableSendfile: Control whether the sendfile kernel support is
# used to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems. Please see
# [httpd.apache.org...]
#
EnableSendfile Off

Resources:
[support.microsoft.com...]
[apache.org...]

Brett_Tabke




msg:1253555
 9:20 pm on Aug 6, 2004 (gmt 0)

He's a righteous Dude!

Thanks Coopster. I will let you know how it goes. It is a this next weeks project.

skibum




msg:1253556
 9:54 pm on Aug 6, 2004 (gmt 0)

Was just struggling with this last night:) Aside from having SP1 (I think?) , does the version of XP matter (Pro or Home)?

coopster




msg:1253557
 10:30 pm on Aug 6, 2004 (gmt 0)

No, but you are correct -- if you will install Apache on Windows XP, you must install the Windows XP Service Pack 1.

DRGather




msg:1253558
 3:20 pm on Aug 7, 2004 (gmt 0)

For those who aren't looking for the "I'm a masochist" method of install (sorry... couldn't resist. LOL), there's a project registered over at sourceforge called webserv. It comes prepackaged with PHP5 (although I think they *may* still be working the kinks out) and a BUNCH of other stuff. It's a canned install script. You run it it and end up with a fully functioning apache server with php, mysql, perl, adodb and a ton of other stuff. Don't get me wrong, it's not going to teach you the ins and outs of server installation and configuration, but if all you're looking for is a quick easy and up to date development environment... it's a pretty good choice.

bobnew32




msg:1253559
 4:07 pm on Aug 7, 2004 (gmt 0)

Same thing with phptriad, but its fully working that I know of. Thats what I used a while ago. :)

DRGather




msg:1253560
 4:17 pm on Aug 7, 2004 (gmt 0)

I think I've tried that at one time or another as well. Webserv is functional. I haven't upgraded to the version with php5 yet, but noticed they've had a couple bug releases in the past few days to deal with some php5 related issues. So... I can't necessarily speak to the newest version with php5 and whether it's bug free or not, but I can say that I didn't have one iota of a problem with the previous version. Triad may be another option though. Great point!

paybacksa




msg:1253561
 9:28 pm on Aug 7, 2004 (gmt 0)

XAMPP is good for those wanting a full LAMP set up with easy install:

[apachefriends.org...]

sidyadav




msg:1253562
 1:08 am on Aug 8, 2004 (gmt 0)

Thanks Coopster! Will try it tonight. The current configuration I have is apache2triad (yup, found it hard to install php by itself without a self-installer), but it will be good to try out installing PHP 5 by itself.

Sid

g1smd




msg:1253563
 4:06 pm on Aug 8, 2004 (gmt 0)

I have been using PHPdev for a long time. Version 4.3.2 I think. That has Apache, PHP, PHPmyadmin, Cerebus FTP server, an example PHPwebsite, an Invision forum, and a load of other stuff.

The download site had a test version including PHP 5 some time ago, and I assume they have, or will, update to PHP 5 soon too.

jatar_k




msg:1253564
 8:05 pm on Aug 8, 2004 (gmt 0)

There are a lot of install packages out there but to tell you the truth, if I am running a server for public use I want to do everything by hand and have a proper sysadmin to run everything.

henry0




msg:1253565
 9:04 pm on Aug 8, 2004 (gmt 0)

Bobnew32 PHP Triad is a great pack
Actually I made an addendum as a tutorial in a tech site I co-own (no web or programmer forums) for a few people asked for it
Now as far as I know the last PHP Triad update has been performed for PHP4 not yet for 5
And I do not see any 5 in the making
Any further info?

Regards

Henry

skibum




msg:1253566
 4:11 am on Aug 16, 2004 (gmt 0)

Never done anything with PHP/Apache before. :) Using a book to help get started & think everything is setup ok.

PHP5 is installed in d/php5

Apache is installed in d/Apache2

When a phpinfo.php test file:

<?php
phpinfo();
?>

( File is in d/apachetest/phpinfo.php )

Is run, it brings up: http: //localhost/phpinfo.php which just says page cannot be displayed.

Is there a specific folder where that file needs to go for it to work or is it likely there is something else amiss?

This is just running locally on XP Home & Apache is running.

sidyadav




msg:1253567
 4:22 am on Aug 16, 2004 (gmt 0)

> Is there a specific folder where that file needs to go for it to work or is it likely there is something else amiss?

I don't about Apache 2, but in several packaged-programs (e.g. WAMPs), there is often a folder called "htdocs" or something similar which is the root directory for files to be uploaded in. Give it a try.

Sid

coopster




msg:1253568
 2:43 pm on Aug 16, 2004 (gmt 0)

And wouldn't you know it...


New Installation Instructions

[14-Aug-2004] The latest online version of the PHP Manual contains a completely reorganized Installation and Configuration [php.net] part, which is now splitted up by platforms and servers to ease your first steps with PHP. The manual Windows installation instructions are completely revised, and now suggest you to set environment variables instead of moving files. This way upgrades and configuration changes become more easier.

Hereby we would like to kindly ask everyone who published an article or howto about installing PHP on Windows to revise those instructions according to our latest guide. These new instructions got distributed with PHP 5.0.1 in both the source code and binary versions, and will continue to be shipped with future versions of PHP.


g1smd




msg:1253569
 8:10 pm on Aug 16, 2004 (gmt 0)

The hard-drive folder that is designated as the web root is defined in the httpd.conf file somewhere in the \Apache folder.

Browse that file and then either create the folder in the place that httpd.conf sugdests that it be made, or else make your own folder wherever you want it to be and then edit the httpd.conf file to reflect that.

rus3439




msg:1253570
 1:07 am on Aug 21, 2004 (gmt 0)

Go to FoxServ website. It has Apache/PHP/Mysql intaller all in one. Works great.

epsrx




msg:1253571
 11:26 am on Aug 24, 2004 (gmt 0)

[apachefriends.org...] works well and is very easy to install and run. I got it installed and running in 5 minutes :)

It comes with Mini Perl and they also offer the full version of Perl as a separate install.

henry0




msg:1253572
 8:00 pm on Sep 15, 2004 (gmt 0)

I would like revisiting the thread and particularly PaybackSa’s post
I needed to test in PHP5 like 1,2,3 and tried the XAMPP pack
I installed it on my RH9 test bed; here are my findings:
The pack installed really nicely
But to run it one needs to know how running php files
XAMPP is located : opt/lampp/htdocs/XAMPP/your_application

From an existing RH go to system setting/server setting/services
And shut down HTPPD and MySQL

To start LAMPP
Go to system tool/terminal
And enter: /opt/lamp/lamp start

To test your scripts in action:
[localhost...]

To go back to your regular RH setup do not forget restarting
HTTPD and MySQL

Have fun

Regards

Henry

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved