Introduction to PHP Source code directory Structure _php tutorial

Source: Internet
Author: User
Tags pear php source code sapi
Amin yuchao86@gmail.com

Based on the PHP-5.3.8 source code to share the PHP kernel structure, in order to better understand the PHP script execution process and write efficient script.

The directory structure is as follows:

1. Build and compile-related directories, including Wk,awk and SH scripts for compilation processing, where M4 files are automatically generated by Linux under the compiler program, you can use the buildconf command to manipulate the specific configuration file.

2. ext Extension Library code, such as Mysql,gd,zlib,xml,iconv, such as our familiar extension library, Ext_skel is the Linux under the extension generation script, Windows using ext_skel_win32.php script generation,

Each extension directory includes the PHP_ extension. c File and the PHPT batch test script.

3. Main main directory, including Php.h,main.c,logos.h array and so on, is a major part of the PHP program, defines the program's SAPI interface global variables and so on.

4. NetWare network directory, the previous version does not have this directory, there are two files Sendmail_nw.h and start.c, respectively defined sock communication said the need for header files and specific implementation.

5. Pear Extension Package directory, PHP Extension and application repository shorthand, install-pear.txt file details how to install the specific expansion package, go to see it yourself.

6. SAPI and various server interface calls, such as Apache, IIS, etc., also contains general fastcgi, CGI, etc., if you see the source code of Apache, this directory clearly clear, such as apache_ Hooks and Apache2handler and so on.

7. Scripts the script directory under Linux.

8. Tests test script directory, mainly PHPT script, consists of--test--,--post--,--file--and--expect--three parts. Some of the--ini--parts that need to be initialized can be added.

9. TSRM Thread Safety Explorer, thread safe Resource manager abbreviation, studied PHP source code, you will see this thing everywhere, to ensure the thread security and code consistency in single-threaded and multithreaded models.

Win32 directory, Windows compiles PHP-related scripts, using WSH.

Zend the engine of the folder core, including the life cycle of PHP, memory management, variable definition and assignment, function macro definition and so on.

If you have a better view, please reply to the email discussion, Thank you

http://www.bkjia.com/PHPjc/478531.html www.bkjia.com true http://www.bkjia.com/PHPjc/478531.html techarticle Amin yuchao86@gmail.com based on PHP-5.3.8 source code to share the PHP kernel structure, in order to better understand the PHP script execution process and write efficient script. Directory structure such as ...

  • Related Article

    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.