Tutorial: How to use EasyPHP?
First of all, what is EasyPHP?
EasyPHP is a complete software package including an Apache server, a MySQL database, a fully PHP execution, as well as easy development tools for your web site or your applications.
Ok, but what is it for?
Well, well! EasyPHP is a software allowing the use of PHP and Databases directly from your computer. If you make your own websites you may have noticed you can’t preview your PHP pages from your browser. That’s why you need to have a software such as EasyPHP to do the job.
Also, it is faster to preview your work from your computer (localhost) than from your webserver.
Let’s now see how to use EasyPHP:
- First of all, you will need to download it. So go to visit http://www.easyphp.org and come back to read this post once you are done.
- Install it in Program Files.
- Enter in your new created directory (for example: C:\Program Files\EasyPHP2.0) and pay attention to the /www and /mysql/data directories. The first one is used to store your web projects and the second for your databases.
- Create a new folder (for example: MyProject) in /www and put your full website (index.html, about.html, contact.php, images, CSS, JS and so on) into it.
- Launch EasyPHP. A window should open as shown on this image:
- Now open your browser and enter localhost or http://localhost or 127.0.0.1 (your browser won’t make the difference). Here is a snapshot of what you should get:
Tip: EasyPHP will go to your system tray when you minimize it.
Now, all you have to do is to select your project to preview your PHP pages from you browser. That’s it!
A word about MySQL in EasyPHP:
Before concluding this post, I would like to say a few words about using MySQL with EasyPHP. If you want to test a CMS (Content Management System), E-commerce or a Blog (WordPress…)… on your computer you will first need to create a database.
All you need to do is to create a new folder in C:\Program Files\EasyPHP2.0\mysql\data (for example you could name it as db_myProject) and when prompted during the installation fill as shown below (I took as example a WordPress Configuration):
1 2 3 4 5 6 7 8 9
<?php // ** MySQL settings ** // define('DB_NAME', 'db_myProject'); // The name of the database define('DB_USER', 'root'); // Your MySQL username define('DB_PASSWORD', ''); // ...and password. Leave it blank if you are using EasyPHP!! define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value (...) ?>
In some cases, you may be prompted to change some variables in the php.ini file (for wikis or E-commerce mostly). Go to your system tray and right-button click on the EasyPHP icon and pick Configuration/php. The php.ini file will open in Notebook. Edit the variables, save your file and close it. Then restart EasyPHP to apply the changes.
That’s it for this tutorial. I hope you enjoyed! If you have any question, comment this post and I will do my best to help you.
Want to become a guest author on this blog?