configuring php on localhost

ufclan

New Member
Messages
37
Reaction score
0
Points
0
I am using a windows XP. I just want to know how to configure apache and php so .htaccess works and so i can run phpBB 3. I have PHP 5.2.5 and Apache 2.0.59 and a working MySQL 5
 

ufclan

New Member
Messages
37
Reaction score
0
Points
0
Yes i m configuring everything on my own. I had a look at the log and found that i m forbidden from usuing it. Can any1 tell me how to change the persimmion for localhost
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
you can download this software to running you php in localhost windows
goto this website to more information http://www.apachefriends.org/en/xampp.html

Just a minor clarification for xampp: it is NOT a public server, it was not intended to be used as such, and to configure it to do so would take more time and effort than needed.

Xampp's f***ing great for testing stuff though; I've got 12 different CMS's installed on it so I can figure out which I like most :D Can't think of anything better if you're just looking to do testing before putting a script on x10 (handy cause sometimes a script has a glitch, like an infinite loop, that would give x10 a heart attack or suspend for high resource usage).
 
Last edited:

cyberzone

New Member
Messages
21
Reaction score
0
Points
0
yeah..this for testing php script before you upload php files into the server..:biggrin:
 

ufclan

New Member
Messages
37
Reaction score
0
Points
0
Yep it is only for testing purposes nothing else and thanks. I'll try out xampp. And what about WAMP?
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
I prefer installing Apache, PHP, and MySQL manually as you can know all of its configuration and settings for later usage.

- Prefer installing Apache 2.2.6 using a MSI Installer (Easy to install for Widows Users)

- Use the AccessFileName Directive to alter the filename of Accessfile. (I'm suggesting this because Windows MAY not allow you to have files starting with a period character.) Prefer using
Code:
AccessFileName ht.access .htaccess
in your httpd.conf

- Install PHP (Prefer using php.ini-dist)

- Add the following lines to your httpd.conf
Code:
LoadModule php5_module php/php5apache2_2.dll
AddType application/x-httpd-php .php
I have installed PHP inside the Apache Installation directory and that's why I have used a relative path to LoadModule directive.

- Install MySQL

- Edit the PHP.ini

---- Set Error_reporting = E_ALL (Useful for Testing Environment)
---- Set Extension Directory
---- Un-Comment the Extensions you want to use. (mysql & mysqli - For using MySQL)

I think, this is enough for you to complete your task successfully.

All the best.
 
Last edited:

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Have you modified the default DocumentRoot Directory? If so, you have to set the Permissions for it in httpd.conf
 

lionheart8

New Member
Messages
177
Reaction score
0
Points
0
With Xampp, I have never failed to test any script ...
You do not have to "configure" anything to make it work as apache, mysql etc come pre-configured and ready for use.
You put your php files in htdocs ... & your files are accessible under http://localhost/yourdirectory/yourfile

DB under localhost/phpmyadmin

To find out about your server specifics ... place a phpinfo() file in htdocs & check them out.
 

animerth

New Member
Messages
86
Reaction score
0
Points
0
Windows XP has a problem w/ .* file the NTFS disk system does not like when a file is only given an extetion
 

naim4u

New Member
Messages
51
Reaction score
0
Points
0
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"
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
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"
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
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"
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
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
 
Last edited:

charlies

New Member
Messages
39
Reaction score
0
Points
0
ufclan is a prime example of why people should have to pass an IQ test before being allowed on the Internet.
 

ufclan

New Member
Messages
37
Reaction score
0
Points
0
ufclan is a prime example of why people should have to pass an IQ test before being allowed on the Internet.
I'll take that as an insult .

And eveything u guys keep posting i have tried long b4.
 
Top