Hello,
Let me apologize for the length of this email. From past experience, I found it better to overexplain a problem than underexplain. Also, thanks in advance for any assistance you can provide.
We are migrating to a freebsd system installed almost primarily via ports (for simplicity and upgradeability). I discovered that the port-based php install did not have libcurl, so I went to add this much needed functionality.
By default port, php is compiled like this:
./configure --enable-versioning --enable-memory-limit --with-layout=GNU --with-zlib-dir=/usr --disable-all --with-regex=php --with-apxs2=/usr/local/sbin/apxs --enable-ctype --with-mysql=/usr/local --enable-overload --with-pcre-regex=yes --enable-posix --enable-session --enable-tokenizer --enable-xml --with-expat-dir=/usr/local --with-zlib=yes --prefix=/usr/local i386-portbld-freebsd4.9
I upgraded from the php-port (4.3.3) to php 4.6.6 via source.
I downloaded curl-7.11.2 and compiled it with standard: ./configure make make test # all 100% passed btw sudo make install
This picked up on my ssl libraries, created the curl and curl-config, and placed libcurl.* files in /usr/local/lib
-bash-2.05b$ curl-config --libs -L/usr/local/lib -lcurl -lssl -lcrypto -lz
The curl cli binary allows me to retrieve http & https urls.
So far everything looks good.
So, I go into the php source directory and do this:
./configure --enable-curl --enable-versioning --enable-memory-limit --with-layout=GNU --with-zlib-dir=/usr --disable-all --with-regex=php --with-apxs2=/usr/local/sbin/apxs --enable-ctype --with-mysql=/usr/local --enable-overload --with-pcre-regex=yes --enable-posix --enable-session --enable-tokenizer --enable-xml --with-expat-dir=/usr/local --with-zlib=yes --prefix=/usr/local i386-portbld-freebsd4.9
Note: I have tried this with --enable-curl=/usr/local/lib as well with the same results.
In both cases, php compiles without errors and when I restart apache, it shows the php 4.3.6 installed. phpinfo does NOT return a curl section.
From either the web page or a command line, any script I write with "$whatever = curl_init();" returns "Fatal error: Call to undefined function: curl_init() in ...".
Just to go a bit extra, I ran /sbin/ldconfig (a throwback to when I dealt with redhat linux) and recompiled php (making sure to start with a fresh source directory for good measure). I still have the same problem.
Questions running through my mind:
1. Should phpinfo show information about curl (other than what's listed in the configure command)?
2. What crucial step am I missing in this setup?
3. This may negate some of my points earlier. How can I tell during compile time if curl was recognized or not? For fun, I (just now) used --with-curl=/crapola and that compiled sucessfully as well, telling me that the compile is not seeing my curlib.so files... so...
4. How do I get php to see /usr/local/lib/curlib.so (or /usr/local/lib/curlib.so.2) when --with-curl=/usr/local/lib (and for fun --with-curl=/usr/local/lib/) do not do the trick?
Thanks, John