Customer Login



Recover Password

WorkOrder TS Support Database

 

Bookmark: Root \ Installation Guides \ Part III - Install PHP5 and integrate it with Apache 2.0 or 2.2

Part III - Install PHP5 and integrate it with Apache 2.0 or 2.2


Last Updated: 2010-05-04
This is Part III of a three part guide on how to install Apache2, PHP 5 and MySQL on a Windows computer or server.
Part I covers the Apache Web Server
Part II covers the MySQL Database Server
Part III covers the PHP installation

PART III - Install PHP5 and integrate it with Apache 2.0 or 2.2

Extract the downloaded zip file containing PHP, rename it to php and move it to C:\


Now we need to add C:\php to the Windows Path. This is the recommended way, DO NOT follow other instructions!
14. How do I add my PHP directory to the PATH on Windows?
(Source http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath )

On Windows NT, 2000, XP and 2003:
-Go to Control Panel and open the System icon (Start -> Settings -> Control Panel -> System, or just Start -> Control Panel -> System for Windows XP/2003). You might have to click on "Switch to Classic View" on the top left corner to see "System"!
-Go to the Advanced tab
-Click on the 'Environment Variables' button
-Look into the 'System Variables' pane
-Find the Path entry (you may need to scroll to find it)
-Double click on the Path entry
-Enter your PHP directory ant the end, including ';' before (e.g. ;C:\php)
-Press OK and restart your computer
Note: Be sure to reboot after following the steps above to ensure that the PATH changes are applied.

Now it is time to configure PHP.
You will find two sample configuration files inside the PHP 5 directory, C:\php.
Delete the file php.ini-dist and rename or copy the file php.ini-recommended to php.ini
If you are using PHP 5.3 delete php.ini-development and copy the file php.ini-production to php.ini


Open php.ini with Notepad and search for "extension_dir", change the line to
extension_dir = "./ext/"


Keep php.ini open and look for extension=php_mysql.dll and extension=php_mysqli.dll
Remove the ; in front of the lines, save and close the file.


Now it's time to configure Apache to work with PHP.
WARNING: Ensure you follow the instructions below. Apache expects forward slashes instead of backslashes!
Apache 2.0:

Use Notepad to open the file C:\Apache2\conf\httpd.conf. Search the file for the string "LoadModule" and add these lines below.
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"


Apache 2.2:

Use Notepad to open the file C:\Apache2.2\htdocs\httpd.conf. Search the file for the string "LoadModule" and add these lines below.
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"


Optional
The default Apache configuration has directory indexes enabled which displays the directory content if no index file is found. This is fine for a development server but not for production use.. Locate the <Directory> section handling your htdocs directory and remove the command Indexes
The configuration line should now read Options FollowSymLinks

Save the configuration file and restart Apache 2.
Create the file info.php in your htdocs directory.
Edit info.php and enter the code below.
<?PHP phpinfo(); ?>


Now it's time to test the php installation. Open your web browser and navigate to http://localhost/info.php if you did everything as shown above you should see the screen below and should now be ready to install WorkOrder TS


Problems:

Problem: You receive a PHP error message that you MySQL extension has not been found.
Solution:

The solution to this problem is usually to correct incorrect path entries, make sure that your MySQL and PHP paths point to the correct directories on your hard drive. If this does not work, copy the file libmysql.dll from your PHP directory into your %windir%\system32 directory. Don't forget to restart when you change the Windows PATH

Once fixed you should find this entry when opening info.php



This guide has been written by Network-Technologies.org for WorkOrder TS.com to provide a simple step by step guide on how to get Apache2, MySQL 5 and PHP5 to talk to each other. Please don't copy the content of this page! Feel free to link to it.

 

Title: service tech
Posted By: Andy On: 2008-12-17 17:08
Running: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727)
Thank you, people say thanks all the time I trully mean it, you have made my life less stressfull i will live longer now, you saved my life, thank you.
Title: Thank you!
Posted By: Eric On: 2009-08-31 10:36
Running: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
I also agree, this was the ONLY online tutorial that correctly helped me install the WAMP technologies.

Best, best regards,

Eric
Title: Config for Apache 2.2
Posted By: Steve On: 2010-04-26 18:32
Running: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Hi,

Thanks for the tuto, it is very well written and it worked great. Just a note that if you follow the instructions with APACHE 2.2, then in the httpd.conf you need to call

LoadModule php5_module "c:/php/php5apache2_2.dll"

rather than the LoadModule php5_module "c:/php/php5apache2.dll" written in the tuto, otherwhise you get an error and Apache won't restart.

Thanks again,

Steve
Title: RE: Config for Apache 2.2
Posted By: Mirko On: 2010-05-04 07:40
Running: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
Hi Steve,

I think you missed the Apache 2.2 part below the Apache 2.0 part.
Here is the text:

Use Notepad to open the file C:\Apache2.2\htdocs\httpd.conf. Search the file for the string "LoadModule" and add these lines below.
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

 

Add Your Comment:

Note: All posts require administrator approval. Please allow 24 hours for message approval.

Name:
E-Mail:
Title
Plain text only, less then 65 000 characters.

Which one of the following 3 words is used to describe an animal? Words: paper dog rain

Please answer the question above and type the answer into the text box below.