Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257356 - Problem with set_include_path
Summary: Problem with set_include_path
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: PHP Bugs
URL: http://www.macdevlab.com/test-it/geti...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-02 09:57 UTC by Paolo
Modified: 2010-04-03 22:56 UTC (History)
1 user (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 Paolo 2009-02-02 09:57:17 UTC
When i run the script:
<?
set_include_path('/var/www/mysite');
echo get_include_path();

?>

i get only "." instead of "/var/www/mysite"

Reproducible: Always

Steps to Reproduce:
write a php script as this:

<?
set_include_path('/var/www/mysite');
echo get_include_path();

?>
Actual Results:  
.

Expected Results:  
/var/www/mysite
Comment 1 Marijn Schouten (RETIRED) gentoo-dev 2009-02-02 10:07:56 UTC
Please add "emerge --info", "eix -e php".

Btw http://www.macdevlab.com/test-it/getinclude.php is password protected...
Comment 2 Paolo 2009-02-02 11:24:24 UTC
# emerge --info
Portage 2.1.6.4 (hardened/amd64/multilib, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-hardened-r4 x86_64)
=================================================================
System uname: Linux-2.6.25-hardened-r4-x86_64-Intel-R-_Xeon-R-_CPU_3065_@_2.33GHz-with-glibc2.2.5
Timestamp of tree: Mon, 02 Feb 2009 00:35:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.4.4-r9, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -mcpu=nocona -mtune=nocona -pipe -mfpmath=sse"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mcpu=nocona -mtune=nocona -pipe -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS=""
LINGUAS="it"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 cracklib crypt hardened justify midi nls nptl nptlonly pam readline sse sse2 sse3 ssl tcpd urandom 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="suexec actions alias auth_basic authn_alias authn_anon authn_default authn_file authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache deflate dir disk_cache env expires ext_filter filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling unique_id userdir usertrack vhost_alias auth_digest suexec file_cache" APACHE2_MPMS="itk" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 intel mach64   mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis     sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDI




[I] dev-lang/php
     Available versions:  (5)  5.2.6-r7 5.2.8-r1 5.2.8-r2
        {adabas apache2 bcmath berkdb birdstep bzip2 calendar cdb cgi cjk cli concurrentmodphp crypt ctype curl curlwrappers db2 dbase dbmaker debug discard-path doc empress empress-bcs esoob exif fastbuild fdftk filter firebird flatfile force-cgi-redirect frontbase ftp gd gd-external gdbm gmp hash iconv imap inifile interbase iodbc ipv6 java-external json kerberos kolab ldap ldap-sasl libedit mcve mhash msql mssql mysql mysqli ncurses nls oci8 oci8-instant-client odbc pcntl pcre pdo pic posix postgres qdbm readline recode reflection sapdb session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl suhosin sybase sybase-ct sysvipc threads tidy tokenizer truetype unicode wddx xml xmlreader xmlrpc xmlwriter xpm xsl yaz zip zip-external zlib}
     Installed versions:  5.2.8-r2(5)(14:37:54 01/24/09)(apache2 bcmath bzip2 calendar cli crypt ctype curl exif ftp gd hash iconv imap ipv6 json mhash mysql mysqli nls pcre pdo readline reflection session simplexml sockets spl sqlite ssl tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter xsl zip zlib -adabas -berkdb -birdstep -cdb -cgi -cjk -concurrentmodphp -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -gd-external -gdbm -gmp -inifile -interbase -iodbc -java-external -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -msql -mssql -ncurses -oci8 -oci8-instant-client -odbc -pcntl -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -solid -spell -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -wddx -xpm -yaz -zip-external)
     Homepage:            http://www.php.net/
     Description:         The PHP language runtime engine: CLI, CGI and Apache2 SAPIs.
Comment 3 Paolo 2009-02-08 06:41:40 UTC
any news ?
Comment 4 Paolo 2009-03-11 11:47:09 UTC
any news about it?
Comment 5 Doktor Notor 2010-02-15 14:10:48 UTC
(In reply to comment #4)
> any news about it?

Well, the news is that if you set  php_value include_path anywhere in apache *.conf files or .htaccess then the code here won't have any effect. If you need both, you have to use AllowOverride Options accordingly. 
Comment 6 Matti Bickel (RETIRED) gentoo-dev 2010-04-03 22:56:46 UTC
He's correct. You have to allow your script to do that (either delete .htaccess/apache config directives or set AllowOverride Options). Also see http://www.php.net/manual/en/function.set-include-path.php (especially the comments section) for reference.

If the problem persists, please post a minimal test-case (a script run from the shell would be perfect) and reopen this bug, please.