5

I've been having some trouble getting CURL working with PHP on a server I inherited.

So far I have enabled the extension in my php.ini by uncommenting the extension=php_curl.dll line, and restarting apache.

However, I now receive the following error when starting PHP:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/php_curl.dll

The php_curl.dll file doesn't exist in the aforementioned directory, and I can't find anywhere legitimate to download it from(doesn't seem to be included in PHP, or Curl).


UPDATE
Following the steps provided in the answer here, I was able to compile a new php_curl.so file and install it to the extensions directory.

Cudos go to Francois Deschenes!!

To compile a curl.so (php_curl.dll) module from scratch:

  1. Download and extract a new copy of your version of PHP.
  2. Open a terminal window and go to the curl directory (Type cd php-5.3.3/ext/curl/).
  3. Type phpize.
  4. Type ./configure.
  5. Type make.
  6. Type sudo make install.
  7. Uncomment extension=curl.so in your php.ini.

You should also make sure the extension is commented out before you start the processes, otherwise you may receive an error about the module already existing.


Community
  • 1
  • 1
Jeemusu
  • 10,415
  • 3
  • 42
  • 64

3 Answers3

2

Why don't use

sudo port install php5-curl 

(on php54: php54-curl)?

Sándor Tóth
  • 743
  • 4
  • 10
2

Download the 'port' using the following URL and install it:

http://www.macports.org/install.php

There are different versions and you can select one installation pack for your Mac Version.

After installed, open a terminal and type the following command to install directly,

$ sudo port install php5-curl 

Otherwise - Login to port terminal by just typing

$ sudo port

and type

> install php5-curl

It will get few minutes to install all the dependancies and finally you will see the following message

--->  No broken files found.
Harsha
  • 818
  • 11
  • 10
1

Following the steps provided in the answer here, I was able to compile a new php_curl.so file and install it to the extensions directory.

Cudos go to Francois Deschenes!!

To compile a curl.so (php_curl.dll) module from scratch:

  1. Download and extract a new copy of your version of PHP.
  2. Open a terminal window and go to the curl directory (Type cd php-5.3.3/ext/curl/).
  3. Type phpize.
  4. Type ./configure.
  5. Type make.
  6. Type sudo make install.
  7. Uncomment extension=curl.so in your php.ini.

You should also make sure the extension is commented out before you start the processes, otherwise you may receive an error about the module already existing.

Community
  • 1
  • 1
Jeemusu
  • 10,415
  • 3
  • 42
  • 64