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.