Thursday, November 18, 2004

Installing Apache, PHP and MySQL

After doing a lot of development. Maybe it's time to move for open source. There are a lot of advantages and benefits either from technical aspects or commercial.

Some of the clear and great advantages are
1. They are FREE (or with a very small fee for commercial)
2. A lot of FREE resources (source code, tutorial, forum etc.)
3. Can be deployed on multi-platform OS (Windows and Linux most commonly used)

To install,
Download
Apache, PHP and MySQL

INSTALL & CONFIGURE APACHE

Follow step by step wizard guide to install Apache.
Test Apache working by point your internet browser to http://localhost

INSTALL & CONFIGURE PHP

Then follow step by step wizard guide to install PHP.

After the PHP install is done you should get something that says you will have to manually configure apache to use php. Assuming you have a working Apache server installed, make sure that it is not running.

Navigate to C:\Program Files\Apache Group\Apache\conf\ open the httpd.conf file. Note that you can also get to the http.conf from the start menu. Start > Program File > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File and the window will open up in notepad.

Now hit Ctrl + End if you see something like what follows, you can skip this step. If you do not see that code, copy it. This code will only work if you used the default install folder when you installed php. If you did, copy that code and paste it into the end of the file. Select the code that follows, and hit crtl + c , then go into the httpd.conf file and hit ctrl + v and save the file:

ScriptAlias /php/ "c:/php/"


AddType application/x-httpd-php .php .phtml

Action application/x-httpd-php "/php/php.exe"

Also edit this lines

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#

DirectoryIndex index.html index.php default.php index.htm

Now that we have php installed, it is time to test it. Open up notepad and type the following:

 

 Save it as phpinfo.php. Remember to set it as all files in the drop down menu, or the file will be a text file. Save in the Directory: C:\Program Files\Apache Group\Apache\htdocs. htdocs is the directory where all the files go. You can create endless dir's and browse them. For


Example E:\Program Files\Apache Group\Apache\htdocs\mydir\myfile.php could be accessed as http://localhost/mydir/myfile.php. Once you have that file saved. You will need to start the Server. Click: Start > Program File > Apache HTTP Server >; and look for something like Start Apache in Console.

After you have found it, launch it. You should get a window saying that Apache is running. Now go to Start > Run > and type in http://localhost/phpinfo.php. If you don't see anything, php is not installed correctly. If php is installed correctly, you will see a few large tables, displaying php's configuration.

INSTALL & CONFIGURE MYSQL

Follow step by step wizard guide to install MySQL.

No password for root by default.

You are going to need to start mysql. For myself I made a file that would start mysql for me. Open notepad and type: start c:\mysql\bin\mysqld-nt.exe --standalone and save that as Start MySQL.bat. Once you have saved it, click it. A window should open and then close. Mysql is now running on your computer

Download MySQL administrator at www.mysql.com/products/administrator/ for GUI control of MySQL database.

Resource: http://www.webmasterstop.com/tutorials/apache-php-mysql-installation.shtml

No comments: