How to compile and expand PHP: 1. Download the source code package; 2. Enter the decompressed directory; 3. Dynamically create the extended configure file according to the current PHP version; 4. Execute "php-config"; 5. Compile and install; 6. Introduce extensions; 7. Restart apache.
The operating environment of this article: ubuntu 16.04 system, PHP7.1 version, DELL G3 computer
php extension compilation method
php has been compiled under linux, how to add new extensions to php
Through the phpize that comes with php, for example, my phpize is in /usr/local/php/bin/phpize
1. Go to the official website of the software or pecl.php.net to download the source code package
2. Unzip and enter the decompressed directory
3. Dynamically based on the current PHP version Create an extended configure file
/usr/local/php/bin/phpize
4. Use the generated configure file to execute
./configure --with-php-config=/usr/local/php/bin/php-config
5. Compile and install
make && make install
6. Expand the generated .so in php Introduced in .ini (the extension directory can be viewed with phpinfo extension_dir)
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/扩展.so
7. Restart apache
service httpd restart
Recommended study: "PHP Video Tutorial"
The above is the detailed content of How to compile and expand PHP. For more information, please follow other related articles on the PHP Chinese website!