About PHP Extensions

Source: Internet
Author: User
Transferred from: http://www.linuxchina.net/?p=1361

Compiling and installing php,php generates a number of extensions, which are divided into two dynamic and static compilations.

Dynamic compilation automatically generates so files and is guaranteed to exist: $php/lib/php/extensions/no-debug-non-zts-20060613/, these so files contain the library of functions that PHP can call, PHP dynamically loads these so files when you need to call these libraries in your code.

Static compilation means that these so files are not generated automatically when you compile and install PHP, but instead the libraries in these so files are compiled statically into PHP so that the code is called at the time of invocation.

The difference between dynamic compilation and static compilation:

Each PHP extension generates its own so file when it is dynamically compiled, and the code calls these libraries to dynamically load the corresponding so files, which optimizes the code execution time and controls the size of the PHP memory, while static compilation can also make the code call to the corresponding library, but in the case of high concurrency, Loading PHP's library of functions will bring more memory consumption and affect server performance.

The implementation of dynamic compilation and static compilation:

Dynamic compilation requires that parameter shared be specified at configuration time, for example:
-with-zlib=shared-with-pdo-mysql=shared,/usr/local/mysql
Static compilation does not need to specify the parameter shared, for example:-with-zlib

The above describes the PHP Extensions, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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