Home
Brushtail Administrator's Guide
PHP
Introduction
PHP5
This is the currently recommended version of PHP.
PHP4
If using PHP4, connections to MySQL require MySQL passwords to be
stored in the old format. See section "PHP4 and MySQL" below.
Extensions
The MySQL extension will need to compiled/enabled. If you want to authenticate
users via LDAP then the LDAP extension needs to be compiled/enabled. If you want to authenticate
users via OPO/IMAP (email) then the IMAP extension needs to be compiled/enabled.The security
does require that the php.ini file has the parameter register_globals = Off
.
Below are some instructions for installing PHP on windows
PHP5 and Microsft IIS webserver on Windows
- Install Microsft IIS
- Download PHP5 installer for windows.
Download PHP5 ZIP package (contains libraries) for windows.
- Run PHP5 installer. By default this will install to C:\php
- Copy the ext folder from the PHP5 zip package to C:\php so you end up with
C:\php\ext
- Copy files libmysql.dll, libeay32.dll, ssleay32.dll from the PHP5 zip package
to C:\php.
- Edit C:\windows \php.ini
set parameter
extension_dir = "C:\php\ext"
uncomment the lines
extension=php_mysql.dll
extension=php_ldap.dll
extension=php_imap.dll
- Under Control Panels > Administrative Tools > Services > World
Wide publishing
restart the web server.
Testing PHP
The default document directory with Apache2 is C:\Program Files\Apache Group\Apache2\htdocs.
The default document directory with Microsoft IISis C:\Inetpub\wwwroot.
To test your PHP installation create a test file in the default document directory
called test.php. In this file have the following code.
<?
phpinfo();
?>
Viewed through a web browser, http://localhost/test.php, you should see a page like this that lists the parameters of the PHP installation.
PHP5 and Apache
These intructions are brief and only meant to be a rough guide.
Install apache web server.
Download PHP5 and unzip to c:\php5
add the following lines to the apache config file, httpd.conf.
LoadModule php5_module "c:/php5/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:\php5"
AddType application/x-httpd-php .php
PHP4 and Apache2 web server on Windows
- download latest version php4 ( download zip package not installer version
)
- extract folder and rename C:\php4
- Rename file C:\php4\php.ini-recommended
to C:\php4\php.ini
- Download Installer for Apache2
- Edit Apache configuration file
C:\Program Files\Apache Group\Apache2\conf\http.conf
# Add to the end of the LoadModule section
LoadModule php4_module "c:\php4\sapi\php4apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:\php4"
For any changes in httpd.conf to take effect you must restart Apache.
PHP4 and Microsft IIS webserver on Windows
- download latest version php4 ( download zip package not installer version
)
- extract folder and rename C:\php4
- Rename file C:\php4\php.ini-recommended
to C:\php4\php.ini
- Copy C:\php4\php.ini to C:\windows
- Copy C:\php4\php4ts.dll to C:\windows\system32
- Copy the dll files in C:\php4\dlls to C:\windows\system32
- Check that IIS is installed
- Go to Control Panels > Administrative Tools > Internet Information Services
Right click on Default Web site and got to Properties.
- Check that the Home directory tab is selected.
Click onthe Configuration button
Click on the Add button
For executable browse to the file C:\php4\sapi\php4isapi.dll
For extension use .php

- Go to the Isapi Filters tab.
Click on Add

- Restart web service
PHP4 & MySQL
As of MySQL version 4.1, MySQL changes the way it stores passwords so PHP4 will
not be able to connect to a default installation.
You will need to create a MySQL user account and store the password in the old
format.
mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
See the MySQL website for more details. http://dev.mysql.com/doc/mysql/en/Old_client.html
php.ini
To change PHP parameters you need to edit the php.ini file and restart the web server. Relevant parameters include.
Security
register_globals = Off
File uploads
memory_limit = 10M
post_max_size = 8 M
upload_max_filesize = 8M
file_uploads = On
(duration of sessions in seconds)
session.gc_maxlifetime = 28800
; For Win32 only.
sendmail_from = root@blah.org
Home