PHP Kernel Learning -01-Preparation _php Tutorial

Source: Internet
Author: User
I haven't written anything about PHP for a long time, so let's talk about PHP kernel-related knowledge.


According to the management, we will prepare the environment before we begin to explain:


Environment Preparation:


1. Linux environment, we use Ubuntu/debian both systems can

2. PHP source code, we explain the code for PHP-5.4.13.TAR.GZ, code you can go to the PHP official web interface to download

3. webserver using Nginx, the database is MySQL


where PHP source code must be prepared, nginx and MySQL can be selectively installed


After the PHP source code download is complete, we extracted the source code, first look at the source code directory structure:

Build: Here are some files related to source code compilation

ext:php Extension Source Path

Main


Zend:zend Engine Implementation Directory

pear:php Extensions and application repositories

SAPI: Various server abstraction layer code, such as Apache,nginx, etc.

TSRM: Thread Safety Explorer

Test: Testing the Code


Source view, we use Vim+ctags, if you do not understand what this is, trouble yourself Baidu a bit.

Knowledge Preparation:

PHP source with a lot of macro definitions, before we begin, we first review the macro-related knowledge.

1. Double # # # This is a connector in the C language, so let's take a look at an example and you'll see.

#define TEST (name) hello_# #name

Let's take a look at the result of the call: TEST (World): Hello_world

Do you see it!

2. Let's take a look at the # #, the function of this symbol is to add double quotes after the value of the macro variable substitution, and we'll look at an example

#define TEST (str) #str

Let's take a look at the call: printf (TEST (Hello World)), and the result for printf ("Hello World");

3. #line This command to change the current line number and file name


4. There are also some commonly used macros, these macros we will use in the future to introduce


http://www.bkjia.com/PHPjc/477574.html www.bkjia.com true http://www.bkjia.com/PHPjc/477574.html techarticle I haven't written anything about PHP for a long time, so let's talk about PHP kernel-related knowledge. According to the management, before we start to explain the environment: Environment preparation: 1. Linux ring ...

  • 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.