Apache and PHP with cURL

0

I am running Sun server with Solaris 10/SPARC.

I had/have Apache 1.37 with PHP 5.2.1 running as a dynamic extension, and want to enable cURL support. I have tried to re-compile PHP with the --with-curl-lib switch, and it doesn't seem to work.

This was my compile instructions;

./configure \
--with-apxs=/usr/apache/bin/apxs \
--prefix=/usr/php5 \
--with-mysql=/usr/mysql \
--with-mysqli \
--with-mcrypt \
--with-gd \
--with-jpeg-dir=/usr/mysql/mods \
--enable-mbstring \
--with-zlib \
--with-curllib=/usr/local/curl-7.25/lib \
--enable-pspell

make && make install

After doing this I did a test using;

<?php
if  (in_array  ('curl', get_loaded_extensions())) {
  echo "test1 == TRUE\n";
} else {
 echo "test1 == FALSE\n";
}

echo "test 2\n";
if  (function_exists('curl_open')) {
  echo "test2 == TRUE\n";
} else {
   echo "test2 == FALSE\n";
}
?>

The results are FALSE for both tests, what am I doing wrong?

Rooneyl

Posted 2012-05-04T09:44:49.597

Reputation: 185

Did you restart the server? – Daniel Andersson – 2012-05-04T10:59:55.937

yes, did a full stop and start – Rooneyl – 2012-05-04T11:12:55.210

Answers

0

If the linux build has a php.ini file you may need to add/uncomment a line like the following. I've only had experience with the windows binaries, in which all that is required is to uncomment a line.

extension=php_curl.dll //This line is in the windows php binaries.

extension=curl.so //This seems to be the one linux uses from what I can gather.

Melikoth

Posted 2012-05-04T09:44:49.597

Reputation: 1 604

Like like the curl didn't install properly as I can't find curl.so. – Rooneyl – 2012-05-04T12:33:05.517

1

I found an article which mentioned the need to install the curl development libraries. I also found a topic on StackOverflow that might help: http://stackoverflow.com/questions/4976971/compiling-php-with-curl-where-is-curl-installed

– Melikoth – 2012-05-04T18:06:17.717