First things first – Make a cloud directory
As i said on my Migration post back than, It is highly recommended to create the environment while keeping in mind that you should not administrate the env, but use tools that can manage the environment for you with as little interference for your development time.
If you are working from several computers (I have my laptop and my office computer and my partner’s computer) you should consider using a cloud directory. There are so many of them these days, but because most of your resources are text files (With extensions like *.php or *.html, but still text), you don’t really have to purchase a big storage, the free cloud services will do.
DropBox cloud folder
I personally use dropbox as my cloud folder and it does the job perfectly. So, because this tiny fact, the guide will be written with dropbox folder, but hey, this is a democracy people, i believe all cloud directories has the same features…
So, go to dropbox.com and register as a user. I’ll wait until you come back…
Now, install the dropbox folder, remember to make the folder with non spaced path :
- c:\someFolder\some folder with spaces\- WRONG
- c:\someFolder\someFolderWithoutSpaces – RIGHT
Under the folder ,that dropbox created for you with the path you asked for, create sub folder and call it “PHP”, or “Work”, or “sources”, or…. you name it.
This is the first thing to do. Later we will configure the web server to look at the sub folder you just created as the localhost directory tree. Just wait and continue with the guide.
Setting Web server and Database
Again, you can take the migration to PHP 5.6 guide and do this step fast without troubles.
But, this is a complete step by step as i said, so, let me just cut and paste the instructions and we are good to go 🙂 (Not really, just kidding, writing it sown from scratch).
You can skip the lecture about web servers and databases, i give here a general idea about what this is, nothing too deep. So, if you already been there, you can jump ahead and continue with the installation guide for XAMPP.
What is web server?
From dictionary :
A Web server is a program that, using the client/server model and the World Wide Web’s Hypertext Transfer Protocol ( HTTP ), serves the files that form Web pages to Web users (whose computers contain HTTP clients that forward their requests).
Why is this important? What is got to do with PHP? Good questions, but not for this guide, sorry to say. Get the general knowledge about web servers and protocols, it is interesting, and learning new skills is always better than…not.
The web server that we will use in our environment is apache. an open source web server, and as a good and free product, this is the most common web server (Beside IIS for Microsoft lovers among you).
What is database?
From dictionary :
A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content: bibliographic, full-text, numeric, and images.
We will use MySql database, that is the most common database for online developers for several reasons much better than me in MySql website.
Needles to say, this is also an open source product, and is free and very well supported.
These 2 products, plus the latest PHP version is available to download and install on each and every machine you may now. From your home PC to your small laptop, this runtime environment can fit into all. But it takes time to install, configure and integrate these 3 dudes together.
This is why i am introducing (Once more) – XAMPP……..
“To make it convenient for developers, XAMPP is configured with all features turned on. In the case of commercial use please take a look at the product licenses, from the XAMPP point of view commercial use is also free. There are currently distributions for Windows, Linux, and OS X.”
This quote is from XAMPP about us page. This is the accurate reason i recommend using XAMPP and not trying to install every thing yourselves. Remember : You are a developer, and not an administrator for development environment. You want to use your time on code and features, not installations and configurations.
XAMPP (Don’t be that way, read the migration to PHP 5.6 guide already!) comes to make your life so much easier. Most of the frustrated developers i worked with know to develop but crashed when it came to administration, how to connect the dots between these 3 monsters…
Now, please, go to the installation step i wrote and follow the steps (The link will take you directly there). Remember, when talking about changing the “DocumentRoot” on the post, enter the DropBox path you created in the first step.
Back so soon? Good, you can start your web server but when you go to “http://localhost” on your browser you will see nithing yet, because there are no resources to show as web page. So just create a text file and name it “index.php” and save it to the “PHP” sub folder under your dropbox folder
Know what,Just download the index.php file from here and extract it under your documentRoot (From now on, “documentRoot” reffers to your sub folder in the DropBox path).
Now, when you go to “http://localhost” oin your browser you will see the PHP version components… This is kinda good to know, but just raise a toast to a successful installation.