Styles

Thursday, March 4, 2010

Apache Configuration

XAMPP Server Configuration

When installing xampp, generally you wouldn't want to keep all your PHP applications nested within the installed folders incase you choose to uninstall it for a newer version. The following file will need to be configured to place php applications in your own project folder (e.g. D:\Projects\Php\)

C:\Program Files\xampp\apache\conf\httpd.con

DocumentRoot "D:/Projects/Php"
<Directory "D:/Projects/Php">
     Options Indexes FollowSymLinks Includes ExecCGI
     AllowOverride All
     Order allow,deny
     Allow from all
 </Directory>

DocumentRoot for phpMyAdmin

When changing the DocumentRoot as shown above, this will change the location of the mySQL admin console. Therefore a shortcut for "phpMyAdmin" must be created on D:/Projects/Php from C:\Program Files\xampp\phpMyAdmin. This will allow for access to mySQL via http://localhost/phpMyAdmin

Default Documents

If you don't want to specify the .php extension in the URL by having a default php load within any folder on your site, you can add any specific php file names to the following file:

C:\Program Files\xampp\apache\conf\httpd.conf

DirectoryIndex index.php

XAMPP mySQL databases location

Databases can generally be copied and pasted from the following location:

C:\xampp\mysql\data

Database Corruption

Sometimes the database can get corrupt from copying files from the \data\ directory. This will need a reboot of the xampp server. Once this happens there will be an error message on the site saying that "[table_name] has crashed or is corrupt and will need a repair". If that is the case you must run the following on the mySQL database:

REPAIR TABLE [table_name]

Default "root" User for mySQL databases

The default password for root is blank, however changing this can be done from the xampp control panel by click the "Shell" button and typing the following command

mysqladmin -u root -p password NEWPASSWORD

Where NEWPASSWORD is the password you want to specify

Default "root" password for phpMyAdmin


The following lines need to be updated in the file: C:\xampp\phpMyAdmin\config.inc.php

$cfg['Servers'][$i]['user']                 = 'root';
$cfg['Servers'][$i]['password']             = 'NEWPASSWORD';

1 comment :

Anil IT Expert said...

I will share it with my other friends as the information is really very useful about Xampp. Keep sharing your excellent work. how to change port number in xampp server