Reinstall
As you've install PHP from source, you'll need to recompile PHP to include CURL.
# Return to PHP source directory
sh ~> cd /path/to/php/src
# Clean previus build
sh ~> make clean
# Configure with CURL
sh ~> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl
# Compile & Reinstall PHP
sh ~> make
sh ~> sudo make install
Enable CURL without re-installing
Another option would be to build a shared-object CURL extension, and enable it within your php.ini
file. The configuration format for PHP shared-object follows --with-<name>=shared,<path-to-lib>
. Repeat the make clean
step, and use the following configuration flags:
# Configure CURL for shared object ( you may need to use --with-curl=shared,/usr )
sh ~> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl=shared
# Compile
sh ~> make
# Copy shared-object to php extensions (paths may differ)
sh ~> sudo cp -p modules/curl.so /usr/local/lib/php/extensions/no-debug-non-zts-BUILD_ID/curl.so
# Enable CURL into systems php.ini
sh ~> sudo echo 'extension=curl.so' >> /usr/local/lib/php.ini
Test
Easiest way to test if curl is enabled
# List all PHP modules & filter on CURL
sh ~> /usr/local/bin/php -m | grep curl
curl