Kompilace PHP --with-curl

Volčko Vladimír vvolcko na csas.cz
Pondělí Září 16 16:21:04 CEST 2002


DD!!
  Po kompilaci php-4.2.3 na stroji s RH7.2 mi prestaly chodit fce
vyuzivajici curl. V predchozi verzi (4.2.2) instalovane z rpm bylo vse OK.
Php kompiluji s temito parametry:

./configure 'i386-redhat-linux' '--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' '--with-config-file-path=/etc'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-dbg=shared'
'--with-dbg-profiler' '--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl'
'--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf'
'--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv'
'--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png'
'--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr'
'--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger'
'--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-discard-path' '--enable-track-vars' '--enable-trans-sid'
'--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap'
'--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=/usr' '--with-pgsql' '--enable-memory-limit' '--enable-bcmath'
'--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx'
'--enable-dio' '--enable-mcal' '--enable-mbstring'
'--enable-mbstr-enc-trans' '--with-apxs=/usr/sbin/apxs' '--with-pdflib'

./configure a nasledna kompilace probehnou bez problemu ... curl funkce vsak
nefunguji ...
 vse testuji jednoduchym skriptikem (podotykam ze na dalsich serverech s php
4.2.2 instalovanych z rpm se dockam kyzene url):

<?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://seznam.cz/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec($ch);
curl_close($ch); 
echo $result; 
?>

na strankach php.net se pise:
In order to use the CURL functions you need to install the CURL package. PHP
requires that you use CURL 7.0.2-beta or higher. PHP will not work with any
version of CURL below version 7.0.2-beta. 

To use PHP's CURL support you must also 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. 

Presne tak to je. Pozadovane soubory jsou v /usr/lib  a /usr/include/curl
(pro jistotu jsem jeste udelal symbolicke linky do /usr/include na
pozadovane knihovny). At jiz kompiluji s volbou --with-curl nebo
--with-curl=/usr nedockam se funkcnosti curlu v php. Verze Curlu je 7-9-8-1.

Nenapada nekoho kde by mohl byt zakopany pes? 

 S pozdravem Vlada


Další informace o konferenci Linux