PHP kernel learning-01-preparations _ PHP Tutorial

Source: Internet
Author: User
PHP kernel learning-01-preparations. I haven't written anything about PHP for a long time. This time, let's talk about PHP kernel-related knowledge. According to the management, before we begin to explain, we should first prepare the environment: environment preparation: 1. Linux environment has not written anything about PHP for a long time. This time we will talk about the knowledge of PHP kernel.


According to the management, we should first prepare the environment before starting the explanation:


Environment preparation:


1. in Linux, we can use both ubuntu and debian systems.

2. php source code. The php source code is php-5.4.13.tar.gz. you can download the code from the php official website.

3. webserver uses nginx and the database is mysql


The php source code must be prepared. nginx and mysql can be installed selectively.


After the PHP source code is downloaded, decompress the source code. let's take a look at the directory structure of the Source Code First:

Build: mainly files related to source code compilation.

Ext: PHP extension source code path

Main:


Zend: zend Engine Implementation Directory

Pear: php extension and Application Repository

Sapi: various server abstraction layer codes, such as apache and nginx

TSRM: thread security Resource Manager

Test: test code


To view the source code, we use vim + ctags. if you do not understand what this is, please baidu.

Knowledge preparation:

Many macro definitions are used in PHP source code. before getting started, we should first review macro-related knowledge.

1. Double # This is the connector in C language. let's take a look at an example and you will understand it.

# Define TEST (name) hello _ # name

Let's take a look at the result of the call: TEST (world): hello_world

Do you understand!

2. let's take a look at #, which is used to add double quotation marks before the value after the macro variable is replaced. let's look at an example.

# Define TEST (str) # str

Let's take a look at the call: printf (TEST (hello world); the result is printf ("hello world ");

3. # The line command is used to change the current row number and file name.


4. there are also some commonly used macros which will be introduced later.


Bytes. According to the management, we should first prepare the environment: environment preparation: 1. Linux environment...

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.