Jump to content
xisto Community
Sign in to follow this  
FaLgoR

Installing Apache + Php5 + Mysql On Windows Sistems

Recommended Posts

We will use Apache 1.3.*, because it's not recommended that we run PHP on Apache 2.0 on wondows sistems. First, download the following programs:

- Apache 1.3.*
- MySQL 4.1.9
- PHP 5.0.3

2. Installation
- Execute Apache's installation program and install it wherever you want, with the default options.
- Extract the MySQL database on the same folder of apache (the same folder than htdocs)
- Extract PHP on C:\php5

3. PHP Configurations
Go to c:\php5 eand copy the file php5ts.dll to the following folders, according to your windows:

- c:\windows\system (on Windows 9x/Me)
- c:\windows\system32 (on WindowsXP)
- c:\winnt\system32 (on Windows NT/2000)

Copy this file c:\php5\libmysql.dll to one of the folders above, according to the windows you are runing. This file is required to run MySQL on php. Still on c:\php5, change the name of the file "php.ini-dist" to "php.ini" and open it. Search for this line:
extension_dir = "./"
and change it for:
extension_dir = "c:/php5/ext/"
This is the directory where the php extensions will be (MySQL, Curl, GD, and others). Now, search for this line:
;extension=php_mysql.dll
and erase the ; of the begining. If you want to active phpgd library, do the same thing on this line: ;extension=php_gd2.dll.

Save and move this file to one of this folders:
- c:\windows (on Windows 9x/Me/XP)
- c:\winnt (on Windows NT/2000)

4. Apache configurations
Go to the folder where you have installed apache and open conf/httpd.conf in some text editor. (Just like notepad).

1ş) Search for the line #LoadModule unique_id_module modules/mod_unique_id.so and after it, add:
LoadModule php5_module "c:/php5/php5apache.dll"

2ş) Search for the line AddModule mod_setenvif.c and after, add:
AddModule mod_php5.c

3ş) Search AddType application/x-tar .tgz and after add:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

4ş) Search:

<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>

And change it to:

<IfModule mod_dir.c>
DirectoryIndex index.html index.php default.php main.php
</IfModule>


5. MySQL Configurations
There is nothing to configure on MySQL, you just have to start runing it. Go to the folder where you installed mysql and open bin/mysqld.exe, it will start mysql server. Remember that you will always have to start mysql.

6. Now, start Apache and MySQL servers again to save the changes. Done! Now you have php and mysql on your computer!

To make a test, create a new file called phpinfo.php, with the following contents:

<?
phpinfo();
?>

so, put it on htdocs inside the Apache folder. Open your browser and type LOCALHOST/phpinfo.php. If the page with all the informations of php is loaded, it means everything is ok.

Note: If you want to turn register_globals on, open c:\windows\php.ini, search for the line "register_globals = Off" and change it to "register_globals = On".

Hope it helped you guys! =D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.