Installing PHP5 Under Windows XP and Apache

Discuss Wi-Fi setups, cybersecurity, and network troubleshooting.
Post Reply
User avatar
ccb056
Site Administrator
Posts: 981
Joined: January 14th, 2004, 11:36 pm
Location: Texas
Contact:

Installing PHP5 Under Windows XP and Apache

Post by ccb056 »

http://www.webmasterworld.com/forum88/4495.htm
Running as a server module

1. Download 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.

Code: Select all

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 pages of the PHP manual.
# Copy the php.ini-dist file from the C:\php folder to your C:\WINDOWS directory and rename it php.ini.
# 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:

Code: Select all

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:

Code: Select all

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...

Code: Select all


[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 = [email protected]
;
; 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:

Code: Select all

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

Post by Guest »

Another option would be to install wampserver. Which allows you to develop & test on your loacal box. See below for details.

I have been using the appz and love it!

WAMP5 installs automatically Apache 1.3.31 ,PHP5, MySQL database ,PHPmyadmin and SQLitemanager on your computer. It's principal aim is to allow you to easily discover the new version oh PHP : PHP5. WAMP5 comes with a service manager installed as a tray icon. It allows you to manage WAMP5 and access all services.
Post Reply