PHP Tutorial – Installation
In this tutorial you will learn about PHP – Installation steps involved in Installing Apache server, Installing PHP 4 and Installing PHP 5.
Installing Apache server:
1- Download the installer from Apache site:
http://httpd.apache.org/download.cgi
2- Double-click on the installer file to start the installation process.
3- You will get a welcome screen, select Next to continue the installation process.
4- You will be prompted to accept the Apache license.
5- After you accept the license, the installer presents you with a brief introduction to Apache.
6- Then the installer will ask you to provide basic information about your computer.
7- The next screen enables you to choose the type of installation.
8- If everything goes well, it will present you with the final screen.
Installing PHP 4:
1. Download the file php-version.zip from PHP site:
http://www.php.net/downloads.php
2. Uncompress the zip file to the path you want the PHP to reside.
3. In the PHP installation directory, find the php.ini-dist file and rename it php.ini.
4. Move the php.ini file to the windows directory.
5. Move the php4ts.dll file to C:\WINDOWS\SYSTEM\ or C:\WINDOWS\SYSTEM32/.
6. Go to Apache installation directory, find the file httpd.conf, it’s under the conf directory, then find the following section:
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
At the end of this section add the following:
LoadModule php4_module c:/php-version/sapi/php4apache2.dll
Notice: replace c:/php-version with the PHP directory.
7. In the same file find the following section:
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
At the end of this section add the following:
AddType application/x-httpd-php .php .phtml .html
AddType application/x-httpd-php-source .phps
Installing PHP 5:
PHP 5 comes in a windows installer file, the installer installs itself, and sets the needed environment variables.