This is a quick start beginner's how-to manual explaining how to quickly setup a PHP 5 installation on a Windows XP PC. You must have an Apache webserver installed and working on your personal computer.This tutorial was written primarily to supplement the MrArrowHead.Com PHP tutorials, and is not intended for setting up, and configuring a high traffic web-server.
Below is a list of what you need before you start trying to install PHP.
- An Apache server installed and running (Click here for Apache installation instructions)
- PHP 5 software (Download here)
- Check PHP hash.(Checking File hash is covered in the Apache Install)ff6e5dc212823009e68f26d66d85cbac
Quick Install for Windows xp
- Extract the PHP file (php-5.2.3-Win32.zip) to a directory
- Set an environment Variable for PHP
What these two steps mean simply is that you need to extract your zip-file into a directory, and tell windows where to find it. I suggest you call the directory c:/php. Then you need to make that path known to your operating system. To set the environment variable for php do the following.
- Go to start on your desktop
- Control panel
- Environment Variables
- Select path. and type in c:/php; at the end of the other stuff
- Now you need to make the following changes to your php.ini file.
php.ini is the configuration file for your php installation. It is text based and pretty strait forward with a lot of its' functionality. You will find php.ini down in your php directory. I will cover only the basic configuration here. I suggest that you take time to go over to php.net when you are ready to delve into more complex configurations.
- Open your php.ini file in a text editor. Notepad will work for windows.
- Search php.ini for doc_root
Set your doc_root to the root directory of you Apache server. It should look something like this:
doc_root =C:Apache Software FoundationApache2.2
- Set extension_dir .
The extension directory is where you find and add php extensions. You will find it also in your php directory. Example:
extension_dir = C:phpext
Make the Following changes to your Apache httpd.conf file.
WARNING BE SURE TO BACK UP httpd.conf BEFORE MAKING CHANGES!
Select start / all programs / Apache http server / Configure Apache Server / edit the Apache httpd.conf configuration file.
When you open the file add the following lines of code at the top.
- LoadModule php5_module c:/php/php5apache2.dll
- AddType application/x-httpd-php .php
- PHPIniDir c:/php
Reboot Windows And your installation Is complete!
When Windows loads back up you will get some status stuff about Apache and PHP starting. If all has gone well with your installation, the server should start and you'll be ready to start writing php scripts. If your web server won't run, then you probably made a mistake in either the httpd.conf file or the php.ini file. Go back and check them. Make sure that you did not change anything other than what was written about here.
If Apache IS running, then it's time to write your first script and test out your php 5 installation.
- Open a text editor like Notepad++ or notepad for windows
- Create a file called test.php, and save it in your htdocs on your web-server
- Now write the following PHP script to your newly created file, and save it.
echo <h1>My PHP must be working!</h1>;
- Open your web-browser and type in http://localhost/test.php.
If everything is working you will get this output:
My PHP must be working!
Now you are ready to start learning how to write PHP.
odd number php script
Testing for Odd/Even Numbers - PHP
Example Banner Rotation PHP Script Odd/Even Numbers
The easiest way to setup an Odd / Even test using PHP i
Storing image locations mysql Storing Image Url Location in Mysql Database
Storing images in the Mysql Database using php can be done by encoding the whole image with a function called base64enco
notepad plus Notepad++
Download Notepad Plus Plus
Notepad plus plus is an open source, free text editor. It is
how to open create write files php Php file functions, Opening a file in php, reading a file in php, writing a file in php
In this tutorial we will look at the most commonly used file functions used in php. The
register globals long arrays php Security, php.ini, register_globals and register_long_arrays
Author: D.Shaun Morgan
Versions and Skill Level
PHP Version - PHP 5x