PHP learning journey-building the PHP environment and building the php Environment

Source: Internet
Author: User

PHP learning journey-building the PHP environment and building the php Environment

1.wampserver.exe Software Download

Http://www.wampsferver.com/ address: select the corresponding version to download.

The access to the above foreign websites may be slow. You can download it from my Baidu online storage:

Http://pan.baidu.com/s/1misVr0s

2. wampserver Service Control Panel

 

 

The main control is the configuration of the entire wampserver, mysql, php, apache, website root directory, and management of some configuration files.

 

 

It mainly involves service restart, exit, and set language.

3. How to check whether the package is installed

Open the browser and enter localhost and press Enter. If the following page appears, it indicates that the installation is successful.

 

 

If the input localhost does not respond, it may be because port 80 is occupied. By default, Apache enables port 80.

3.1 how to modify the default apache port in wampserver

 

 

 

After opening, you need to modify 2 places. crtl + f search for 80

 

 

 

 

 

Replace the above 80 with the unused port. Here I use 8082.

4. Customize the website root directory

To enable our php code to be separated from the service, we can put our php code in a separate directory. The default root directory of wampserver is the www directory under the installation directory.

 

 

To facilitate management, we can set the root directory of the website to the location we want to specify. Here I select the php folder in the d directory.

4.1 modify the httpd. cof File

 

 

Change the DocumentRoot directory to D:/PHP/

 

 

Modify Directory D:/PHP/

4.2 modify the wampmanager. ini file

 

 

Change the www directory to the PHP Directory.

Change the FIleName value to D:/PHP/

4.3 modify the wampmanager. tpl File

 

 

Change $ {w_wwwDirectory} to the PHP Directory

Change the FIleName value to D:/PHP/

5. hello world

Create a hello world. php file under the configured website root directory

<?php  echo "hello world";?>

 

Write the preceding content and save

Http: // localhost: 8082/then input hello world. php In the browser to see the "hello world" text.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.