LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2004, 09:36 AM   #1
hurieka
LQ Newbie
 
Registered: Jul 2004
Posts: 6

Rep: Reputation: 0
Question Curl and PHP...?


Hello,
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!
Why?
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
 
Old 07-24-2004, 07:19 AM   #2
hurieka
LQ Newbie
 
Registered: Jul 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Can somebody help me with this?
Pleaseeeeeee....
That is not much text for you, please...
 
Old 09-26-2004, 03:26 PM   #3
pimp1911
LQ Newbie
 
Registered: Aug 2004
Distribution: Centos 5.x
Posts: 10

Rep: Reputation: 0
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.
 
Old 09-27-2004, 07:33 PM   #4
Simon_6162
Member
 
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141

Rep: Reputation: 16
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(); ?>

Last edited by Simon_6162; 09-27-2004 at 07:35 PM.
 
Old 09-27-2004, 11:00 PM   #5
pimp1911
LQ Newbie
 
Registered: Aug 2004
Distribution: Centos 5.x
Posts: 10

Rep: Reputation: 0
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 libphp4.so and do a ldd on this file. Does curl show up there.
 
Old 09-28-2004, 06:58 AM   #6
Simon_6162
Member
 
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141

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

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

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 libphp4.so
linux-gate.so.1 => (0x003ff000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00632000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00302000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x00111000)
libpspell.so.15 => /usr/lib/libpspell.so.15 (0x00f69000)
libpcre.so.0 => /lib/libpcre.so.0 (0x002c2000)
libpanel.so.5 => /usr/lib/libpanel.so.5 (0x00781000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x00e14000)
libgmp.so.3 => /usr/lib/libgmp.so.3 (0x00bbb000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0021d000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00411000)
libz.so.1 => /usr/lib/libz.so.1 (0x00130000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00141000)
libdb-4.2.so => /lib/tls/libdb-4.2.so (0x00317000)
libcurl.so.2 => /usr/lib/libcurl.so.2 (0x006be000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x0015f000)
libresolv.so.2 => /lib/libresolv.so.2 (0x0016e000)
libm.so.6 => /lib/tls/libm.so.6 (0x00180000)
libdl.so.2 => /lib/libdl.so.2 (0x001a3000)
libssl.so.4 => /lib/libssl.so.4 (0x001a7000)
libcrypto.so.4 => /lib/libcrypto.so.4 (0x00486000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x009c1000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00577000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x008d7000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00a6a000)
libc.so.6 => /lib/tls/libc.so.6 (0x00785000)
libaspell.so.15 => /usr/lib/libaspell.so.15 (0x008da000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00a8c000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x001db000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x001e3000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0046f000)

hope this helps.
 
Old 09-29-2004, 12:14 AM   #7
pimp1911
LQ Newbie
 
Registered: Aug 2004
Distribution: Centos 5.x
Posts: 10

Rep: Reputation: 0
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 libphp4.so and see if curl comes up there.

Last edited by pimp1911; 09-29-2004 at 12:51 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Curl under PHP ttxmika Slackware 11 05-31-2005 12:24 PM
PHP/cURL housemusic42 Linux - Networking 0 10-07-2004 03:45 PM
Compile PHP to use Curl pimp1911 Linux - Software 3 09-24-2004 09:56 AM
php and curl Risen Linux - Software 0 09-02-2003 04:41 PM
PHP and CURL install on Mandrake 9 dmcentire Linux - Distributions 0 10-21-2002 08:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration