PHP introduction:
PHP's unique syntax is a mix of C, Java, Perl, and PHP's own syntax. It can execute dynamic web pages more quickly than CGI or Perl. Compared with other programming languages, PHP embeds programs into HTML documents for execution. The execution efficiency is much higher than the CGI that generates HTML tags completely; PHP can also execute the compiled code, which can encrypt and optimize code execution to make code run faster.
PHP environment construction:
You can use integrated software (php, apache, and mysql) to build the php environment. You can also download php, apache, and mysql to build the environment.
Many php beginners spend a lot of effort in setting up the environment, leading to the loss of interest in learning php. Therefore, we recommend that Beginners use integrated software to build the environment, with the continuous development of learning, I will go back to understand the environment. That is to say, let everyone build the environment first, learn the basic knowledge of php, cultivate their interest in php, and then go back and study what is going on in the local environment.
There are two main types of software for building the php environment:
I,Wamp is suitable for building the php environment.
II,Appserv is suitable for server environment construction
We recommend that you use wamp when learning php.
It is easy to install wamp. We recommend that you use the default configuration for installation.
After installation, enter localhost in the browser and press Enter. If the wamp homepage appears, the installation is successful and the Environment configuration is successful.
After the installation, a wamp folder is generated in the root directory of the C drive by default (if it is installed on another disk, It is similar). In the wamp folder, there is a www directory.
We must first open the wamp program, which is enabled in the local environment.
Create a test. php file under the www directory,
Then enter:
<? Php echo "hello world! ";?>
Enter localhost/test. php In the browser
Output
Hello world
That is to say, localhost corresponds to the www directory, which is accessed by entering the file address in the browser.