Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 343015 - dev-lang/php-5.3.3-r1[+sqlite3 -sqlite] but no link with sqlite3 shared object
Summary: dev-lang/php-5.3.3-r1[+sqlite3 -sqlite] but no link with sqlite3 shared object
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 00:13 UTC by Yutaka, GOTOH
Modified: 2010-12-28 12:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yutaka, GOTOH 2010-10-28 00:13:35 UTC
I choice to sqlite3 to handle zabbix application.
my environment has very small memory size, thus I can't run full-function RDBMS.

emerge php-5.3.3-r1 with sqlite3 without sqlite, compile was succeed, but PHP binary don't link sqlite3 shared object.


Reproducible: Always

Steps to Reproduce:
1. emerge php5-3.3.3-r1
   with use flags. (below)
dev-lang/php  apache2 -postgres -mysql -sqlite sqlite3 gd cli pcre xml zlib bcmath sockets
2. compile wad succeed.

Actual Results:  
PHP object don't link sqlite3.so and don't have sqlite3_* functions.

Expected Results:  
should be used sqlite3_* functions on PHP5.

# emerge --info php
Portage 2.1.8.3 (default/linux/amd64/10.0/server, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-gentoo-r12 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.34-gentoo-r12-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8500_@_3.16GHz-with-gentoo-1.12.13
Timestamp of tree: Wed, 27 Oct 2010 03:15:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 1.3.7-r1, 2.1.11
dev-lang/python:     2.5.4-r3, 2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.4, 4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -mfpmath=sse -O3 -pipe -fomit-frame-pointer -funroll-loops"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/tomoyo/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -mfpmath=sse -O3 -pipe -fomit-frame-pointer -funroll-loops"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests autoaddcvs ccache distlocks fixpackages news parallel-fetch protect-owned quickpkg sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.gg3.net/  http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO  "
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j 8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/matsuu /var/lib/layman/ruby /var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"
USE="acl amd64 apache2 berkdb bzip2 cgi cjk cli cracklib crypt cxx dri fastcgi fortran gdbm iconv ipv6 ldap maildir mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline ruby session slang snmp sse sse2 ssl svg sysfs tcmalloc tcpd threads truetype unicode vhosts xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.3.3-r1 was built with the following:
USE="apache2 bcmath berkdb bzip2 cgi cjk cli crypt ctype fileinfo filter gd gdbm hash iconv ipv6 json ldap (multilib) nls phar posix readline session simplexml snmp sockets sqlite3 ssl threads tokenizer truetype unicode xml xmlreader xmlwriter zlib (-adabas) (-birdstep) -calendar -cdb -concurrentmodphp -curl -curlwrappers -db2 (-dbmaker) -debug -doc -embed (-empress) (-empress-bcs) -enchant (-esoob) -exif (-firebird) -flatfile -fpm (-frontbase) -ftp -gd-external -gmp -imap -inifile -interbase -intl -iodbc -kerberos -kolab -ldap-sasl -libedit -mssql -mysql -mysqli -mysqlnd -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -recode -sapdb -sharedext -sharedmem -soap (-solid) -spell -sqlite -suhosin (-sybase-ct) -sysvipc -tidy -wddx -xmlrpc -xpm -xsl -zip"


# ldd /usr/bin/php
        linux-vdso.so.1 =>  (0x00007fff1e5ff000)
        libreadline.so.6 => /lib/libreadline.so.6 (0x00007fdd90a7c000)
        libmcrypt.so.4 => /usr/lib/libmcrypt.so.4 (0x00007fdd90836000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007fdd90632000)
        libonig.so.2 => /usr/lib/libonig.so.2 (0x00007fdd903b1000)
        libldap-2.4.so.2 => /usr/lib/libldap-2.4.so.2 (0x00007fdd90165000)
        liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0x00007fdd8ff55000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00007fdd8fd3e000)
        libt1.so.5 => /usr/lib/libt1.so.5 (0x00007fdd8facc000)
        libm.so.6 => /lib/libm.so.6 (0x00007fdd8f849000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fdd8f561000)
        libz.so.1 => /lib/libz.so.1 (0x00007fdd8f341000)
        libpng14.so.14 => /usr/lib/libpng14.so.14 (0x00007fdd8f106000)
        libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007fdd8eea0000)
        libdb-4.8.so => /usr/lib/libdb-4.8.so (0x00007fdd8eb02000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fdd8e8e6000)
        libgdbm.so.3 => /usr/lib/libgdbm.so.3 (0x00007fdd8e6de000)
        libbz2.so.1 => /lib/libbz2.so.1 (0x00007fdd8e4c6000)
        libpcre.so.0 => /lib/libpcre.so.0 (0x00007fdd8e289000)
        libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007fdd8e028000)
        libnetsnmp.so.15 => /usr/lib/libnetsnmp.so.15 (0x00007fdd8dd57000)
        libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007fdd8d976000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007fdd8d5ef000)
        libc.so.6 => /lib/libc.so.6 (0x00007fdd8d293000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007fdd8d02c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdd90ccd000)
        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00007fdd8cdd4000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00007fdd8ca10000)


phpinfo()
sqlite3
SQLite3 support	enabled
SQLite3 module version 	0.7-dev
SQLite Library 	3.6.23.1

Directive	Local Value	Master Value
sqlite3.extension_dir	no value	no value


apache test code
# cat /var/www/localhost/htdocs/index.php
<?php
  phpinfo();
  $db = sqlite3_open( '/var/lib/zabbix/home/zabbix.sqlite' );
  echo $db;
?>

apache errorlog
[Thu Oct 28 08:42:17 2010] [error] [client 192.168.0.229] PHP Fatal error:  Call to undefined function sqlite3_open() in /var/www/localhost/htdocs/index.php on line 3
Comment 1 Matti Bickel (RETIRED) gentoo-dev 2010-11-03 19:07:09 UTC
Does using the object oriented syntax help?
I'm able to use
php > $m = new SQLite3('my.db');
php > $m->exec('CREATE TABLE bar (bar STRING)');
php > $m->exec("INSERT INTO bar VALUES ('bla')");
php > $r = $m->query('SELECT * FROM bar');
php > $row = $r->fetchArray();
php > var_dump($row);
array(2) {
  [0]=>
  string(3) "bla"
  ["bar"]=>
  string(3) "bla"
}

just fine. AFAIK sqlite3 doesn't offer procedural access.
Comment 2 Yutaka, GOTOH 2010-11-04 21:35:06 UTC
> Does using the object oriented syntax help?
> I'm able to use

snip.

I confirmed that can use object-oriented syntax in current PHP ebuild, too.
and, If I write a program from scratch with PHP and sqlite, I will use
new(object-oriented) syntax.

> just fine. AFAIK sqlite3 doesn't offer procedural access.

but, zabbix is coded by classical(?) methods.


Comment 3 Ole Markus With (RETIRED) gentoo-dev 2010-12-28 12:43:51 UTC
As far as I can tell, this bug has nothing to do with the Gentoo distribution of PHP. It seems like the issue is that zabbix doesn't support sqlite3.