Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144303 - PHP+PEAR through portage... problem with constants
Summary: PHP+PEAR through portage... problem with constants
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-18 04:53 UTC by Javi Ruiz
Modified: 2006-10-01 09:41 UTC (History)
0 users

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 Javi Ruiz 2006-08-18 04:53:51 UTC
There is a problem with PHP constants when installing PHP and PEAR through portage.

I've seen that the recommended way to install php+pear is just to install firstly PHP and then the package PEAR-PEAR. When you do this, PHP gets installed without pear support, but having "/usr/share/php;/usr/share/php5" in the include_path directive in php.ini does the thing, because PEAR stuff gets installed in that directories...

The problem now comes because the PHP constant PEAR_INSTALL_DIR is empty! (constant that I use for example to find files like pear-build.xml from the "propel-generator" package). I guess this constant is empty because it's a php constant and php doesn't install any support for pear...

Is this really a bug? or just me missing anything in php+pear installation??

thanks a lot!

ah! just in case... my emerge --info :

Portage 2.1-r2 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-gentoo-r4 i686)
=================================================================
System uname: 2.6.17-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.12.4
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop -falign-functions=4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop -falign-functions=4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.intergenia.de "
LDFLAGS="-Wl,-O1"
LINGUAS="en es_ES"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/ipl_ebuilds /usr/local/overlays/misc /usr/local/overlays/xgl-coffee /usr/local/overlays/proaudio"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac aalib acpi aim alsa apache2 apm artworkextra audiofile avi bash-completion bitmap-fonts browserplugin bzip2 bzlib cdr cgi cjk cli crypt cups dba dbm dbus dga divx4linux dlloader doc dri dts dvb dvd dvdread eds emboss encode esd evo examples exif fat firefox flash font-server foomaticdb fortran freetds freewnn ftp gd gif gimpprint glitz gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml hfs i8x0 iconv imagemagick imap imlib inifile isdnlog java javascript jikes jpeg jpeg2k ldap libg++ libwww lm_sensors mad maildir mikmod ming mjpeg mmx mng mono motif mozdevelop moznomail mp3 mpeg msn mssql multiuser mysql nautilus ncurses network nls nptl nptlonly ntfs objc odbc offensive ogg oggvorbis opengl oss pam pcre pda pdf pdflib pear perl php png pnp posix postgres ppds pppd python qt3 qt4 quicktime readline real reflection reiser4 reiserfs samba sata sdl session simplexml slang slp sndfile soap sockets speex spell spl sql sse sse2 ssl startup-notification stats subversion svg tcltk tcpd tetex theora threads tidy tiff tokenizer truetype truetype-fonts tse3 type1-fonts udev unicode updated-acpi updated-bluetooth usb userlocales vcd videos vorbis win32codecs wmf wxwindows xface xfs xine xml xml2 xmlreader xmlrpc xmlwriter xmms xorg xosd xpm xprint xs xscreensaver xsl xv xvid zip zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_en linguas_es_ES userland_GNU video_cards_i810 video_cards_i915"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sebastian Bergmann (RETIRED) gentoo-dev 2006-09-30 02:25:27 UTC
Both phing and propel-gen seem to work fine for me without the PEAR_INSTALL_DIR variable.
Comment 2 Javi Ruiz 2006-10-01 09:41:07 UTC
Yep, both modules work properly without the constant, but when you need to find any file manually inside the PEAR modules directory(ies) (like xml, xsd files or any other) you don't have the PEAR_INSTALL_DIR constant; when the normal behaviour of a php installation is to set this constant if you run the configure script using the flag for pear support...

Anyway... because this is not only a problem with Gentoo's Portage (I also found the same problem installing php and pear packages separately in Debian using apt-get) I found that it's better to search inside each of the include paths set in the php.ini file. Not a fix tho, but a workaround ;)

For me,s something like the following did it:

$sFilePath = null;
$aPHPIncludes = explode(PATH_SEPARATOR, get_include_path());
foreach ($aPHPIncludes as $sInclude)
{
if (substr($sInclude, -1) != '/') $sInclude .= '/';
if (file_exists($sInclude . 'data/propel_generator/pear-build.xml'))
    $sFilePath = $sInclude . 'data/propel_generator/pear-build.xml';
}


Thanks. Greetings!



(In reply to comment #1)
> Both phing and propel-gen seem to work fine for me without the PEAR_INSTALL_DIR
> variable.
>