Home >Backend Development >PHP Tutorial >PHP environment setup (using the integrated environment phpnow)_PHP tutorial
It is not difficult to set up a PHP environment, but the process is a bit cumbersome. It would be time-consuming and laborious to build a PHP + MySQL environment using original programs. And errors of this kind often occur when configuring PHP. Problems such as mysql extension and zend installation failure. Here we share a way to quickly build a PHP operating environment using an integrated environment and how to build a virtual host, that is, the phpnow software.
If you really want to install the entire PHP operating environment step by step, you can refer to the article on this site:
How to set up a PHP running environment under Windows 7
phpnow is a fast, standard and professional PHP package that can easily and quickly build a professional PHP running environment. Let’s take a look at the specific process below.
First download the latest version of PHPnow from http://servkit.org/download. PHPnow has two packages, one is the exe self-extracting version (recommended, this article is for this version), and the other is the pure 7z file (without exe self-extracting).
Execute PHPnow-1.4.x.exe and the following picture will appear. Just press Enter (note that you must select the installation directory here, because the installation program will be automatically executed after the decompression is completed. If you decompress to the desktop, it will be automatically installed into the file directory on the desktop).
After automatic decompression is completed, Init.cmd will be automatically executed for initialization (firewall prompts may appear during this period, please allow). As shown below:
Init.cmd can be completed in ten seconds. After all is completed, the default page will be opened automatically (if not, try opening http://127.0.0.1 manually).
If you just want to build a website, the above environment is enough. Very often we need to open multiple independent websites. For example, separate forums and homepages, share servers with friends, etc. At this time, a virtual host will be used.
Let’s talk about the use of PHPnow virtual host. Very simple.
Double-click to execute D:PHPnowPnCp.cmd (maybe your installation path is not D:PHPnow), enter 2 and press Enter. Follow the prompts to enter the new virtual host information. As shown below:
After entering the information and pressing Enter, Apache will be automatically restarted to take effect. Then visit the domain name you just added, making sure to resolve the domain name and point it to your server IP in advance.
If you don’t have a domain name or don’t know how to use it, you can use the “virtual domain name” by editing C:WINDOWSsystem32driversetchosts.
The bbs.test.com in this example is implemented by adding a line "127.0.0.1 bbs.test.com" to the next line of "127.0.0.1 localhost".
You may also need to assign a MySQL database to each virtual host. Here is how to use phpmyadmin to assign users and databases.
Open http://127.1/phpMyAdmin; log in as root.
Then click “Permissions” and then “Add New User”.
Fill in the new username and password;
Select the second option “Create database with same name and grant all privileges”.
Others remain as default; it should be mentioned that global permissions do not need to be selected unless necessary. Otherwise, do not select them at all.
Click [Execute] to complete. If you don’t understand, just look at the picture.
Just give the user the username and password you just added. Note that root has the highest authority, do not give the password to others easily.
Okay! You now have a professional PHP server environment.