Tuesday, September 27, 2011

Configure Xampp on Windows

As you already know Xampp is a prepared environment to develop web applications with Apache, PHP and MySQL.
The good thing is that you don't have to spend time to install and configure these separately.
Once you've installed it  you may have to configure Xampp on windows to adapt it to your needs though, so here you can see some tips and tricks to tune up your Xampp installation on Windows

Launch PHP on the command line

Add C:\xampp\php\ to your environment variable windows PATH
Append your XAMPP PHP directory at the back of what is already there ;C:\xampp\php\


Increase PHP memory limit

Edit php.ini in c:/xampp/php/php.ini

change memory_limit to whatever you want:

memory_limit=256M


Add your web sites

Go to the Httdocs folder create a folder named old, cut and paste all loose files (not directories)
Then copy or create your own website folders:

/httdocs/website_1
/httdocs/website_2
/httdocs/website_3

You will access to them like this:

http://localhost/website_1


Xampp on windows: use MySQL on the command line

cd c:\xampp\mysql\bin

Set the root password:
mysqladmin.exe -u root password yourpassword


Connect to mysql:

mysql.exe --user=root --password=yourpassword

Load SQL file:

source c:/db/my_database.sql;

If all this fails reset root password to empty by executing: c:/xampp/mysql/resetroot.bat


Add a Virtual Host configuration

c:\xampp\apache\conf\httpd.conf

For a personalized configuration:

Add or edit files in:
c:\xampp\apache\conf\extra

So there, you can configure Xampp to work on windows and then deploy your pages and make it work on a Linux machine!

0 comments:

Post a Comment

Your opinion is very appreciated, thank you!