installing Apache in Localhost.

naim4u

New Member
Messages
51
Reaction score
0
Points
0
configuring php on localhost - Today, 08:15 AM



Before we install Apache, we need to make sure the Windows Internet Information Server (IIS) is disabled (if it is installed and running). The reason is that IIS and Apache are both web servers and they will conflict if they are both running at the same time. Note that if you want continue to use IIS (e.g. for local ASP.NET website development), you will be able to easily switch IIS and Apache on and off so you can use both. This step just tells you how to switch IIS off temporarily so we can install Apache.

to make sure IIS is not running, do the following: Start | Settings | Control Panel | Administrative Tools | Services. Then click on column label "Name" to list the services in reverse alphabetical order. If IIS is running then you will see an entry named "World Wide Web Publishing" at the top. Click on that and then click the stop button.

We now need to tell the Apache web server what to do when it encounters a .php5 file. Some changes will be made to the Apache configuration file and some will be made to the PHP configuration file
1. With the Windows Explorer, create the folder c:\webs\test. This will be our test website
2. Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the c:\php\php.ini file: (1) doc_root = "c:\webs\test" and (2) extension_dir = "C:\php\ext". Note that you should use BACKSLASHES in the php.ini file.

3. In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the DocumentRoot entry to: DocumentRoot "C:/webs/test". Note that you should use FORWARD SLASHES in the http.conf file.

4. Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the Directory entry to: <Directory "C:/webs/test">.Note that you should use FORWARD SLASHES in the http.conf file.

5. Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add the following lines: hint: to find this position fast, search for "media types"
Quote:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "C:/php"
6. Lastly, we need to make one last change to this C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. Find the "DirectoryIndex" entry and add "index.php" to the end of the line
Quote:
DirectoryIndex index.html index.html.var index.php5
7. In order for the changes to take effect, you need to restart Apache. To do this, click the Apache symbol in the lower right-hand corner of your task bar. In the little menu that pops up there, click Apache 2 and then Restart
Edit:
Before we install Apache, we need to make sure the Windows Internet Information Server (IIS) is disabled (if it is installed and running). The reason is that IIS and Apache are both web servers and they will conflict if they are both running at the same time. Note that if you want continue to use IIS (e.g. for local ASP.NET website development), you will be able to easily switch IIS and Apache on and off so you can use both. This step just tells you how to switch IIS off temporarily so we can install Apache.

to make sure IIS is not running, do the following: Start | Settings | Control Panel | Administrative Tools | Services. Then click on column label "Name" to list the services in reverse alphabetical order. If IIS is running then you will see an entry named "World Wide Web Publishing" at the top. Click on that and then click the stop button.

We now need to tell the Apache web server what to do when it encounters a .php5 file. Some changes will be made to the Apache configuration file and some will be made to the PHP configuration file
1. With the Windows Explorer, create the folder c:\webs\test. This will be our test website
2. Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the c:\php\php.ini file: (1) doc_root = "c:\webs\test" and (2) extension_dir = "C:\php\ext". Note that you should use BACKSLASHES in the php.ini file.

3. In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the DocumentRoot entry to: DocumentRoot "C:/webs/test". Note that you should use FORWARD SLASHES in the http.conf file.

4. Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the Directory entry to: <Directory "C:/webs/test">.Note that you should use FORWARD SLASHES in the http.conf file.

5. Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add the following lines: hint: to find this position fast, search for "media types"
Quote:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "C:/php"
6. Lastly, we need to make one last change to this C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. Find the "DirectoryIndex" entry and add "index.php" to the end of the line
Quote:
DirectoryIndex index.html index.html.var index.php5
7. In order for the changes to take effect, you need to restart Apache. To do this, click the Apache symbol in the lower right-hand corner of your task bar. In the little menu that pops up there, click Apache 2 and then Restart
Edit:
Before we install Apache, we need to make sure the Windows Internet Information Server (IIS) is disabled (if it is installed and running). The reason is that IIS and Apache are both web servers and they will conflict if they are both running at the same time. Note that if you want continue to use IIS (e.g. for local ASP.NET website development), you will be able to easily switch IIS and Apache on and off so you can use both. This step just tells you how to switch IIS off temporarily so we can install Apache.

to make sure IIS is not running, do the following: Start | Settings | Control Panel | Administrative Tools | Services. Then click on column label "Name" to list the services in reverse alphabetical order. If IIS is running then you will see an entry named "World Wide Web Publishing" at the top. Click on that and then click the stop button.

We now need to tell the Apache web server what to do when it encounters a .php5 file. Some changes will be made to the Apache configuration file and some will be made to the PHP configuration file
1. With the Windows Explorer, create the folder c:\webs\test. This will be our test website
2. Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the c:\php\php.ini file: (1) doc_root = "c:\webs\test" and (2) extension_dir = "C:\php\ext". Note that you should use BACKSLASHES in the php.ini file.

3. In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the DocumentRoot entry to: DocumentRoot "C:/webs/test". Note that you should use FORWARD SLASHES in the http.conf file.

4. Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the Directory entry to: <Directory "C:/webs/test">.Note that you should use FORWARD SLASHES in the http.conf file.

5. Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add the following lines: hint: to find this position fast, search for "media types"
Quote:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "C:/php"
6. Lastly, we need to make one last change to this C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. Find the "DirectoryIndex" entry and add "index.php" to the end of the line
Quote:
DirectoryIndex index.html index.html.var index.php5
7. In order for the changes to take effect, you need to restart Apache. To do this, click the Apache symbol in the lower right-hand corner of your task bar. In the little menu that pops up there, click Apache 2 and then Restart the apache which is at the right side of start menu
 

Jesse

Active Member
Messages
1,360
Reaction score
0
Points
36
Thanks for this info. I saved it to my computer, it might help me someday when i try to setup one ;)
 

Dan

Active Member
Messages
1,258
Reaction score
0
Points
36
Very good!! I've saved it too for future reference.
 
Top