How to Install PHP 5.x on Windows
PHP Install Tutorial
This php tutorial is intended for developers - both beginners and Experts to setup a testing WAMP server on personal computers or laptops.
PHP Tutorial Covers:
How to Install PHP 5 on Windows 7.
PHP Windows Install Steps
- Download PHP Zip File.
- Create a Folder "c:/php".
- Extract the PHP Zip file to "c:/php".
Set Windows environment variable for PHP.
Setting the Environment Variable "makes" the "c:/php" path "known" to Windows 7 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 in the text-box
- Next We Focus On php.ini.
Using Default php.ini Configurations
Defaults with a few exceptions will get us up and running.
I DO suggest, however, that you mske time to go over to php.net when you are ready to delve into more complex configurations.
Now Some Noteworthy Points
- php.ini holds the core PHP configuration settings.
- php.ini is text-based and the syntax is simple and easy to learn.
- php.ini,by default, can be found in the php install directory -
- Open your php.ini file in a text editor. I recommend Notepad++ for Windows.
- Type ctrl-f
Search php.ini for "doc_root"
Set doc_root to the Apache Web-Server install folder:
doc_root = "C:Apache Software FoundationApache2.2"
The extension directory is where you find and add php extensions. Windows php extensions are binary ".dll" ( stands for dynamic link library) files with php_ added to the front of the filenames.
extension_dir = "C:phpext"
Changes To Apache httpd.conf
http.conf holds all the apache server configurations
WARNING BACK UP httpd.conf BEFORE MAKING CHANGES! MISTAKES CAN CRASH YOUR SERVER.
- Select start / all programs / Apache http server / Configure Apache Server / edit the Apache httpd.conf configuration file.
- Add the following lines of code to the top of the page.
For Apache 2.2
- LoadModule php5_module "c:/php/php5apache2.dll"
- AddType application/x-httpd-php .php
- PHPIniDir "c:/php"
For Apache 2.4
- AddType application/x-httpd-php .php
- AddHandler application/x-httpd-php5 .html .htm
- PHPIniDir C:/php
- LoadModule php5_module C:/php/php5apache2_4.dll
- Reboot Windows And your installation Is complete!
When Windows loads back up you will probably see status messages about Apache and PHP starting.
If all has gone well with your installation, the Apache should server will start.
If your web server won't run, then you probably made a mistake in either the httpd.conf file or the php.ini file.
This would be great time to go back and get those backups from earlier in th tutorial
Make sure that you did not change anything accidentally such as typing an accidental character or space by bumping the keyboard.
If all else fails, Call Obewan and drop in the backup configurations files to their respective folders which should restore balance to the force!
Conversely if Everything is Up and Up (Router/Networking GeekSpeak for those of us who took Cisco Netecad)
Then it's time to write your first script and test out your new development box!.
- Open a text editor like Notepad++ or notepad for windows
- Create a file called "test.php," and save it in your Apache "htdocs" (web-server root folder).
- Now write the following PHP script into your newly created file
< ?php 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:
Imagejpg To Base64
How To Make Browser Go Back To Last Page With Using Php
Binary Search User Functions
Php Conditional Statments If Else Switch
Textarea Code Overflow
Convert Timestamp To Readable Date Time Using Php
Creating Image Watermarks
Need To Print Out An Array Using Php
Odd Number Php Script
How To Upload Images And Files Using Php
Using Php Cookies Variables
How To Unzip Files On Your Free Hosting Account
Passing Data From One Form To Another Form Using Php
Just In Time Compiling
Storing Image Locations Mysql
How To Turn Variable Value Into Variable Name
How To Use Dreamweaver
How To Open Create Write Files Using Php
Stop Form Spam Captcha
Retreive Images Mysql Using Php
How To Make Money Online
Store Images Mysql Using Php
Php Example Post Array
How To Write Php Functions
How To Write Html Form Using Php
Register Globals Long Arrays
How To Install Php 5
Php Passing Variables
My PHP must be working!
Now you are ready to start learning how to write PHP.