Home > Article > Backend Development > Two ways to add CURL extension library to PHP
2, compile and generate the extension into the ext directory in the PHP source program directory, where the source code of each extension module is stored. Select the module you need, such as curl module: cd /usr/webserver-soft/php-5.2.14/ext/curl/ Execute phpize to generate the compiled file. phpize is in the bin directory of the PHP installation directory.
In this way, curl.so will be copied to the corresponding PHP directory (such as: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/) 3. Modify the configuration in php.ini and set the extension directory: extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/" And add extension module reference: extension = curl.so 4. Check and restart Apache /usr/local/php/bin/php -v When executing this command, php checks whether the configuration file is correct. 5, check the loaded modules of php /usr/local/php/bin/php –m | grep curl |