Here is a quick Apache / PHP / MySQL startup guide.
HTH!
Server Selection
=================================================
Select a computer as a server. This is the computer on which the softwares would be insatlled. Make sure that the server is connected to the other computers and centrally accessibly by the clients (or from computers). You can check this by ping the server computer. To do that issue the following command at the client computer:
Code:
ping xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the ip address of the server computer. For e.g.
if you receive a series of reply from the server, then the clients can access the server.
Installation and Configuration
=================================================
Following is the procedure to Install, configure and integrate Apache, PHP and MySQL on the Windows plateform.
1. Create / Modify the "HOSTS" file On Windows 98, goto Windows Directory and edit "HOSTS" file (without quotes), no extensions, just the file name.
On Windows NT/2000/XP, this file is located in the "WINDOWS\system32\drivers\etc" directory. If the file doesn't exist, create it.
Add the following line to the file
Code:
127.0.0.1 localhost
xxx.xxx.xxx.xxx dpb.loc
xxx.xxx.xxx.xxx www.dpb.loc
where xxx.xxx.xxx.xxx is the ip address of the server computer.
Save and close the file and issue the following command in the command prompt
if you receive a series of reply from the server, then the host configuration is complete.
2. Install PHP
=======================================================
Unzip the php installation zip file to a directory such as "C:\PHP" or "D:\PHP".
Make sure that while unzipping, you have selected the "Use folder name" (in WinZip). This option 'll automatically create the subdirectory and put the respective files automatically.
After you have unzipped the files. Edit the "php.ini" file. If the php.ini file does't exists, then copy and rename the "php.ini-recommended" to "php.ini".
Edit php.ini file and find the "extension_dir" entry and enter the absolute path of the directory
Code:
extension_dir="C:/PHP/extensions/"
make sure you enter the directory where you installed the
PHP and take care of the slashes while entering. Save and close the file.
Enter the following command in the command prompt in the PHP directory
If you see the the version of php printed without any errors. The PHP has been successfully installed.
3. Install MySQL
=======================================================
Install the MySQL installation package. It is advised to install the MySQL in the root directory like "C:\mysql" or "D:\mysql"
In case you are installing MySQL in directory other than "C:\mysql", create a file "my.ini" in the WINDOWS directory and add the followin line to it
Enter the absolute path of the directory where you installed the MySQL. (take care of entering the slashes)
To start the mysql server, start the C:\MySQL\bin\mysqld.exe file or C:\MySQL\bin\mysqld-nt.exe on Windows NT/2000/XP. Now run C:\MySQL\bin\mysql.exe (the client). If you are successfull in connecting to the server, mysql has been successfully installed.
4. Create a web root directory.
=======================================================
Create a director "C:\www" or "D:\www" as the root directory where all the sites data would be saved.
5. Install Apache
=======================================================
Install the apache from the installation package. After you have installed the apache, edit the "httpd.conf" file located in the "APACHE\conf\" directory.
If the "httpd.conf" doesn't exists, copy and rename the "httpd.conf.default" to "httpd.conf"
Add the following line, near the LoadModule block.
Code:
LoadModule php4_module "D:/PHP/sapi/php4apache.dll"
Add the following lines, near the AddType block
Code:
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3 .php .phtml
Add the following lines at the end of the file
Code:
NameVirtualHost 127.0.0.1
NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost 127.0.0.1 xxx.xxx.xxx.xxx>
ServerName dpb.loc
ServerAlias www*.dpb.loc
<DocumentRoot "D:/www/dpb">
Options Indexes FollowSymLinks +Includes +ExecCGI
AllowOverride None Order allow,deny
Allow from all
</Directory>
</VirtualHost>
where xxx.xxx.xxx.xxx is the server's ip address
and the "D:/www/dpb" is the location of the website.
Move the php4ts.dll and php4ts.lib files from the C:\PHP to the WINDOWS\System or WINDOWS\System32 directory.
Copy the php.ini file from the C:\PHP to WINDOWS directory.
Start the apache by starting the APACHE\bin\apache.exe file or from the Start Menu > Apache HTTP Server > Control Apache Server > Start
Goto your browser and type www.dpb.loc You should see the contents of the site of the directory listing, in case the folder is empty. Your apache is running successfully.
Testing PHP w/Apache
=======================================================
Create a text file and name it phpinfo.php in the
D:/www/dpb/ folder withe the following content
PHP Code:
<?php phpinfo(); ?>
Now enter the following url in the browser www.dpb.loc/phpinfo.php and you should see lots of content about the server and currect settings.
Bookmarks