-   Linux - Software (
-   -   Curl and PHP...? (

hurieka 07-23-2004 08:36 AM

Curl and PHP...?
I`m new here, I find this forum on google, this forum is great and biiig...and I`ll come here again every day because I`m newbie in linux world...:(

I search forum and I can`t find how I can compile PHP to use CURL software...that is big problem for me and on net I can`t find all steps...
Can somebody help to me?
I think that I have that software on server:
cd usr/bin
curl --version
curl 7.9.8 (i386-redhat-linux-gnu) libcurl 7.9.8 (OpenSSL 0.9.7a) (ipv6 enabled)

But I can`t use that software in PHP!
What I must do now?

Also, is this software secure? (with this software somebody can use telnet, ftp, http and much more...)

Can somebody provide here secure setup of this software in PHP?

Thank you...

Sorry for my english:(

hurieka 07-24-2004 06:19 AM

Can somebody help me with this?
That is not much text for you, please...

pimp1911 09-26-2004 02:26 PM

bump. I would like to know the steps as well. According to the php website you are suppose to do a
to compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the "lib" directory. I am little confused on the lib directory. The libcurl.a file is in a different directoy so how would you do the ./configure command to factor in that all the files needed are in different directories.

Simon_6162 09-27-2004 06:33 PM

here is my config line for php

'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2=/usr/sbin/apxs'

that is the default configure on fedora core 2. it looks like php can be configured with --with-curl

I have no idea how it is used in PHP though

I hope thats some help

p.s. you know you can list the current config by making the following php file right ?

<?php phpinfo(); ?>

pimp1911 09-27-2004 10:00 PM

I tried just using ./configure --with-curl. And I have a test.php that I can look at via my browser to show me the php environment. Test.php just has the <?php phpinfo(); ?> in it. When I look at it and do a find for curl. It doesnt show up. If I do a php -m it does show up. Also if you dont mind see if you have a and do a ldd on this file. Does curl show up there.

Simon_6162 09-28-2004 05:58 AM

ok well i have a section in php info that says:

CURL support enabled
CURL Information libcurl/7.11.1 OpenSSL/0.9.7a ipv6 zlib/

what systems are you running e.g redhat 9, fedora etc? are there no prebuild binaries that already have curl built into them. I'm just using the standard fedora ones.

Does curl work properly from the command line ?

the output of ldd => (0x003ff000) => /lib/ (0x00632000) => /lib/ (0x00302000) => /usr/lib/ (0x00111000) => /usr/lib/ (0x00f69000) => /lib/ (0x002c2000) => /usr/lib/ (0x00781000) => /usr/lib/ (0x00e14000) => /usr/lib/ (0x00bbb000) => /usr/lib/ (0x0021d000) => /usr/lib/ (0x00411000) => /usr/lib/ (0x00130000) => /usr/lib/ (0x00141000) => /lib/tls/ (0x00317000) => /usr/lib/ (0x006be000) => /usr/lib/ (0x0015f000) => /lib/ (0x0016e000) => /lib/tls/ (0x00180000) => /lib/ (0x001a3000) => /lib/ (0x001a7000) => /lib/ (0x00486000) => /usr/lib/ (0x009c1000) => /usr/lib/ (0x00577000) => /lib/ (0x008d7000) => /usr/lib/ (0x00a6a000) => /lib/tls/ (0x00785000) => /usr/lib/ (0x008da000) => /usr/lib/ (0x00a8c000) => /lib/ (0x001db000) => /lib/tls/ (0x001e3000)
/lib/ => /lib/ (0x0046f000)

hope this helps.

pimp1911 09-28-2004 11:14 PM

Okay this is what I did. I uninstalled the package version of Curl that comes with Fedora Core 1. That is curl version 7.10.6 and removed the devlelopment curl package as well. You may have to use a rpm -e --nodpes on the curl package to get it removed. I downloaded the source for Curl version 7.11.1 and did a ./.configure --with-ssl since I use ssl. And then did a make and make install on the new version of curl. Then I went over to my php source and used a portion of your .configure to recompile php. A suggestion first though would be to write down your phpinfo "configure " info just in case you have to recompile to what you orginaly had before. Then I did this. make clean. And then ran this from my php source.

./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-gd --enable-gd-native-ttf --without-gdbm --with-zlib --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-regex=system --with-xml --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-kerberos --with-ldap=shared --with-mysql --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mcal --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-apxs2=/opt/app/apache2/bin/apxs

Play close attention to ---apxs2=. This is the location of apache or apache2 in my case.
And --sysconfdir=. This is the location of your php.ini.

Once this completed I did a make and a make install. I have a test.php that I can access via my webserver that shows the details of my compile for php and I saw that curl is now present. A little gotcha here. You may have to bounce your webserver or close your browser and rerun the test.php(which has phpinfo in it). There is alot of extra stuff in the compile of php that I will be playing around with to get down to the bare minimun of just allowing curl. Thanks for your help. I have been searching the internet for 3 or 4 days on this subject.

You can verify by doing a php -m command and seeing if curl shows up. Or do a ldd command on and see if curl comes up there.

All times are GMT -5. The time now is 04:10 PM.