Setting up and using XAMPP
XAMPP stands for X-Cross, A-Apache, M-MySQL, P-PHP and P-Perl. XAMPP can be run on Windows, Linux, Mac that is, it is cross platform. It is used for creating a web server on your local machine. It is easy to setup and requires minimum configuration changes. It comes along with phpMyAdmin, so no need to download it separately. XAMPP is used mainly to debug websites locally and remove any bugs before deploying them on the web. For more information visit Wikipedia.
Steps to setup XAMPP
Step 1- Download and Install XAMPP
Step2- Open XAMPP control panel,
Step 3- Start Apache and MySQL from the XAMPP Control Panel.
Note- Now to test your website, copy the folder containing your website to the following location.
Open the “xampp” folder, it’s present in the drive where you’ve installed xampp. Then open “htdocs” folder and paste your website folder in it.
Step 4- Now open your browser and type this
Note- If you’re not getting this screen take care to see that your apache has been started from the XAMPP Control panel and is running.
The presence of the above screen indicates that the XAMPP has been installed correctly and is running fine.
Step 5- Now to test your website, type this-
If you can see your website than you’ve completed setting up XAMPP.
Common errors and their solutions-
1. MySQL not starting properly- This case occurs when this happens is mostly when you had installed MySQL separately before installing XAMPP and now it’s conflicting with the MySQL installed along with the XAMPP.
Solution- Uninstall the MySQL which you had installed previously delete any files that have been left behind, restart the computer and then try running MySQL through the XAMPP control panel.
2. Apache not starting due to some port error- This case arises mainly when the port Apache tries to access, 80, is being used by some other service.
Solution- Most probably if you have Skype installed and running this is the main source of problem, the remedy is to either change the default port used by Apache or stop Skype for the time being. To stop Skype go to Task Manager and find Skype and right click on it and end the process. Now if you want to change the default port used by apache do this. Open XAMPP Control Panel, click on “config” and then click on “httpd.conf”, find 80 and replace that with other port like 123. Now restart your PC and then try starting apache through XAMPP Control Panel.
3. MySQL error, error connecting to database or authentication failure
Solution- This is caused if the username and password contained in the “config” file of your website is different from the actual username and password you’ve set for MySQL. Change the “config” file default username is “root” and password is blank.
4. PHP code not executing instead it is being displayed or the code is being downloaded.
Solution- This occurs if apache has not being started from the XAMPP control panel. Or you’re not typing localhost/Your_Folder_Name for running your website.
You can run multiple sites at the same time, just copy the site folder as specified in Step-3. Then type localhost/Site1, open a new tab in the browser and type localhost/Site2 to start the second site.
phpMyAdmin comes along with XAMPP so that you don’t have to download it and install it separately.
phpMyAdmin is a free software tool written in PHP used to handle the administration of MySQL with use of a web browser. It can be used to insert, delete update databases, tables, fields or rows. You can import and export MySQL databases easily using it. More information can be found on Wikipedia.
To use phpMyAdmin open web browser and type localhost/phpmyadmin.
A screen will appear prompting you to enter username and password. Default username is root and password is root. If you had changed the username and password while MySQL setup then use that username and password, on successful logging you’ll reach the screen similar to the below one-
Common error and solutions
If you have forgotten the username and password or you’re not able to get through the login screen.
Solution- Caution this solution will cause all the future logins in phpmyadmin, without requirement of any password. Procedure- Open XAMPP Control Panel and click on the “Config” in front of Apache then click on config.inc.php. In the file that will open either you comment the code $cfg[‘Servers’][$i][‘AllowNoPassword’]= TRUE; or add $cfg[‘Servers’][$i][‘AllowNoPassword’]= TRUE; after the if statements, in the following example $cfg[‘Servers’][$i][‘AllowNoPassword’]= TRUE; has been added after the if statements.
//other configuration options
//other configuration options
After doing this restart apache and type localhost/phpmyadmin you’ll notice that this time you’ll not get the login screen.
If you’re facing any difficulties installing XAMPP let us know, leave your comments below we’ll try our best to help you out.