Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling curl in php5

I am using macports on my machine and I realized that curl is not enabled. Is there anyway to enable it without completely reconfiguring php?

Thanks!

like image 352
Danny Avatar asked Apr 15 '10 21:04

Danny


People also ask

What is php5 cURL?

PHP cURL is a library that is the most powerful extension of PHP. It allows the user to create the HTTP requests in PHP. cURL library is used to communicate with other servers with the help of a wide range of protocols. cURL allows the user to send and receive the data through the URL syntax.

How do I enable cURL on Linux server?

The procedure to install cURL on Ubuntu Linux is as follows: Update your Ubuntu box, run: sudo apt update && sudo apt upgrade. Next, install cURL, execute: sudo apt install curl. Verify install of curl on Ubuntu by running: curl --version.


2 Answers

First, make sure you have the most recent version of macports by running this:

sudo port -v selfupdate
port upgrade outdated

According to the macports documentation here, the php5 port should include the curl extension by default. You should be able to install it by doing this from terminal:

sudo port install php56

To install just the curl extension, you can do this:

sudo port install php56-curl
like image 74
plowman Avatar answered Sep 24 '22 10:09

plowman


I am not familiar with macports but if you can locate the php.ini file look for the following line.

;extension=php_curl.so

Change it took

extension=php_curl.so

This will enable the curl module.

Note: the exact extension name might not be the same.

like image 23
Samuel Avatar answered Sep 24 '22 10:09

Samuel