How to Install?
The first step is installing PHP on your computer. But, before that, you will need to understand this simple procedure about how we going to install PHP.
PHP can run by itself, but, here we will let it run on a web server. (That's how PHP is used as a server-side language)
What is a Web Server?
A web server is a software or hardware (or both working together) which processes and serves a response for incoming network requests. In simple words, you type hyvor.com in your web browser. Then, the server of hyvor.com will process the request and server the response to you.
PHP cannot do this without a web server. Therefore, we will install a web server, then PHP.
Here are the steps.
- Installing Web Server (Here we will use Apache)
- Installing PHP
However, you can do both of the above steps at once by installing one of the following web development environments.
- WAMP Server - Only Windows
- XAMPP Server - Supports Windows, Linux, OS X
Note: Those all-in-one packages come with a database like MYSQL. It is better to have a database already installed in your computer as databases are usually used with PHP. If you manually install Apache and PHP, don't worry about a database. We will install it in our databse chapters.
For manual installation on Linux, please see this.
In this tutorial, we will use the Apache Web Server and PHP.
Searching for Solutions
At the beginning, we told you that we will make you a real programmer. To be that, one of the must learn things is searching for solutions. In this installation guide, we will teach you how to search for a solution.
When installing PHP in your computer, those official website (Ex: WAMP website) may not give all the details you need to install it in your computer. The best way is searching for a tutorial.
- Go to Google (The most used search engine).
- Search "How to install PHP on" + your operating system. (Ex: How to install PHP on Windows)
- Now you will get some results. Choose one of the first few websites and read its content. See if it solves your problem.
Installing a text editor
You need a good text editor to write and edit PHP files. The following are some of recommended text editors. Go to those websites and choose any editor you like.
There are some Intergrated Development Environments (IDE) for PHP to make programming easier. But, for now, a text editor is enough for you to learn PHP.