PHP environment installation
If you are just getting started, don’t let your learning difficulties get stuck on environmental issues. Many friends have read some not-so-good books during their studies. I told you to install xxx, but I went around in a big circle and finally gave up.
Before you start learning, you should focus on how to learn to write code and how to write good code.
Regarding the environment issue, just be able to run the code you write now.
What is the PHP development environment
PHP is a development language. Code written in a development language usually needs to be run under specified software. Therefore, if the code we wrote needs to be displayed (run) and seen, we need to install these software to run the code.
We call the software that runs the code we write and the software that runs the code together a development environment.
Environmental problems that novices often encounter before learning
When many friends first learn, they install a certain environment after hearing that it is good. some software. Due to lack of relevant knowledge, I have no opinion. Falling into a strange circle where people are like clouds. Change this today, change that tomorrow.
The current only standard for verifying truth, please always ensure that the
environment can meet your learning needs. Don't waste precious learning time by dwelling on the environment.
We believe that the environment only needs to meet the learning requirements. After you have learned it, you can then work on some more complex specific configurations online and in production environments.
Windows environment installation
The so-called server: Don’t think about it too advanced, it just provides a special function (service) Just a computer.
The one that displays web pages is called web server.
The server that helps us send and receive emails (Email) is called a mail server.
The game server that helps us connect various game players together is called a game server.
The one that helps us store data is called a database server
... ...and so on
The performance of a mobile phone we use now is better than the one 10 years ago The performance of computers and servers should be even more powerful and awesome.
In our learning process, we can use the windows computer we use as a server.
So that’s it, it’ll be clear in one explanation, right?
The computers most of us use are usually computers with Windows operating system. Our explanations are mainly conducted on Windows computers.
You don’t need to understand the so-called advanced computer knowledge, operating system prototypes, etc. In this chapter, you only need to be able to install QQ and anti-virus software. Click: Next and Next to complete the study of this chapter.
At the beginning of learning, we strongly recommend beginners to use the integrated environment package for installation.
What is an integrated environment package?
There are many things we need to install when learning PHP. For example: web server, database server and interpreter of the PHP language core.
We can install each part separately, or we can install an integrated software together.
The software that combines these is called an integrated environment package.
This process requires modifying many configuration files to complete. And everyone's computer situation and authority are often prone to operation errors.
It is easy to be affected by environmental problems. Our learning plan is very absolute in the early stage:
Please use the integrated environment package to complete the initial learning.
After you learn PHP NB well, use whatever you like. There are piles of articles on the Internet to teach you how to configure various environments.
What kind of integrated environment package should I choose?
There are many integrated environment packages. The following are all various English names. It just represents the name of different integrated environment packages, so there is no need to get into it. As shown below:
1. AppServ
2. PHPStudy
3. APMserv
4. XAMPP
5. WAMPServer
... ...and so on
For our new learners, the principles for choosing integrated environment packages are:
1. Fast updates, relatively new versions
2. The operation is simple and easy to use
3. Don’t have too many choices
Therefore, the integrated environment package we use below is: XAMPP. Of course, if you are familiar with this block, you can also choose the integrated environment package by yourself.
You can download it from the PHP official website. The download address is:
You can download it at the official website:
https://www.apachefriends.org/zh_cn/index.html (For some special reasons, it may sometimes be inaccessible in China. )
You can also search in Baidu: *XAMPP * This 5-character alphabet can be downloaded.
XAMPP installation process demonstration
If you know how to install it, you can skip the content.
1. Download the installation package and place it on the computer desktop.
2, double-click to open, and the boot interface for starting the installation will be displayed.
#3. Please remove some unnecessary hooks as shown in the picture. For example: Tomcat, etc.
4, we usually do not put XAMPP in the C drive directory of the computer, because the operating system files are usually placed in the C drive. If the computer breaks down, our code may be lost easily when the system is redone. We need to modify the path:
5, click the small folder-style icon at the back and select the D drive.
#6, click New Folder, write the name of the folder as xampp, and then click OK.
7, the file selection is completed, we click next (next step)
8. Remove the hook at the back as shown in the red box in the picture. (Note: This is mainly a function used to install other PHP programs. We do not need to use it during the learning process.)
9, prompts us to complete the preparation, click next (next step), you can start the installation.
#10, the installation starts at this time, which is the progress bar of the installation.
#11, click finish. Complete the installation of XAMPP.
congratulations! At this step, XAMPP - PHP's integrated runtime environment has been successfully installed!
Other notes after installation
1. Do you see the icon on the lower right foot? This is the quick control panel of XAMPP. Just click and give it a try.
#2, this interface will be displayed after clicking. You don’t need to study this interface in depth for the time being. Just need to know. Stop means to stop and Start means to start. You can try.
#3, in the XAMPP control panel (pictured above). We click on the small button on the right: Explorer. This interface will be displayed. This interface is a picture of the Xampp software installation directory. We need to put all the PHP code, web page code, pictures and other files we write in the future in this. (As shown in the picture: htdocs directory)
4, this is the effect after entering the D:\xampp\htdocs directory. Let me repeat again: We need to put all the PHP code, web code, pictures and other files we write in the future in this.
#5, there is another note: [Do not remove the hook in front of: "Hide extensions for known file types". 】
why?
Because the suffix of our PHP file can only be xxx.php. Many friends initially like to right-click the mouse to create a record file and then change the name to xxx.php. But nothing changes, and it doesn't show up at all. This is because the Windows operating system hides the known file extension .txt behind the xxx.php.txt file.
You can conduct experiments on the computer based on the characteristics I mentioned. Try it and see the effect, it will help your understanding. Select: Tools, Folder Options. As shown in the picture below:
Linux environment installation
Many people are misled by some books on the market and think that they need to learn Linux before learning PHP. As a result, once I look at Linux, I lose hope in life and learning. Linux learning and PHP learning are not necessarily connected. They are two different knowledge systems. We strongly do not recommend students who have not been exposed to Linux to install a Linux environment in order to learn PHPIf you have experience, we believe you will be able to solve it, if not.
Selection of tools for writing code
There are many tools for writing code. For those who are just starting to learn PHP. There are several principles for selecting tools:
1. Do not use tools with automatic prompts (such as eclipse, zend studio and other PHP development toolsets)
2. The code you write must have colors Highlight. (Cannot be used: txt text editor and other editors without code color display)
You may want to ask, why?
We found that programming masters in TV, movies and real life write a bunch of code without any errors and can run it with just one click. But when we plagiarized their code, we made the wrong mistakes. This feeling is very bad! ! !
——These legendary masters have practiced repeatedly on the basic code, so they will not make mistakes.
And we need the realm of masters, and we cannot use advanced tools in the early stages of learning. This will waste our precious opportunities to practice code and debug errors.
Because advanced editors usually have many advanced functions, such as:
1. The code automatically displays errors
2. The code automatically wraps lines
these Advanced tools, for you who are just starting to learn, are not conducive to the ability of novices to solve problems independently!
Recommended development tools
1. NotePad++ (PHP Academy official website download address:)
PHP Academy download address: http://down.phpxy.com/tools%2Fnpp_V6.7.9.2_Installer.1435039587.exe
Baidu download address: http://rj.baidu .com/soft/detail/13478.html?ald
2. GVim without other extensions installed
PHP Academy download address: http ://down.phpxy.com/tools%2Fgvim74.3336883054.exe
Baidu download address: http://rj.baidu.com/soft/detail/12314.html?ald
You only need to download these tools, keep clicking Next, and install them on your computer.