Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193321 - dev-lang/php-5.2.4_p20070914-r2 incorrect symbolic link handling apache mod_fcgid
Summary: dev-lang/php-5.2.4_p20070914-r2 incorrect symbolic link handling apache mod_f...
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-21 12:31 UTC by Gerd Burmann
Modified: 2007-09-21 20:11 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 Gerd Burmann 2007-09-21 12:31:18 UTC
When I emerge dev-lang/php-5.2.4_p20070914-r2 my apache website is no longer accessible via the default way.
In the webroot folder is a symbolic link to the index.php of joomla, so when I just open the website with the domain name the website should open. With the new php version I get the following adress in the browser
http://example.org/installation/index.php but it should be:
http://example.org/index.php
When I call the link target directly via the browser it works:
http://example.org/joomla/index.php
With php-5.2.4_pre200708051230-r2 there was no problem and when I reemerge the old version the problem goes away. The "installation" seems very suspicious to me. Perhaps there is variable in the php code not written correctly.




Reproducible: Always

Steps to Reproduce:
1. emerge new php version
2. restart apache
3. 

Actual Results:  
website gets redirected to http://example.org/installation/index.php and the website is no longer accessible this way

Expected Results:  
website should go to http://example.org/index.php

version used:
 www-servers/apache-2.2.6  USE="ldap mpm-worker ssl threads -debug -doc -mpm-event -mpm-itk -mpm-peruser -mpm-prefork -no-suexec (-selinux) -static-modules" 0 kB
dev-lang/php-5.2.4_p20070914-r2 [5.2.4_pre200708051230-r2] USE="apache2 berkdb bzip2 cgi cli crypt ctype discard-path force-cgi-redirect gd ldap ldap-sasl mysql mysqli ncurses nls odbc pcre pic readline session sharedext sockets ssl threads unicode xml zip zlib (-adabas) -bcmath (-birdstep) -calendar -cdb -cjk -concurrentmodphp -curl -curlwrappers -db2 -dbase (-dbmaker) -debug -doc (-empress) (-empress-bcs) (-esoob) -exif -fastbuild (-fdftk) -filter (-firebird) -flatfile (-frontbase) -ftp -gd-external -gdbm -gmp -hash -iconv -imap -inifile -interbase -iodbc -ipv6 -java-external -json -kerberos -libedit -mcve -mhash -msql -mssql -oci8 (-oci8-instant-client) -pcntl -pdo -pdo-external -posix -postgres -qdbm -recode -reflection -sapdb -sharedmem -simplexml -snmp -soap (-solid) -spell -spl -sqlite -suhosin (-sybase) (-sybase-ct) -sysvipc -tidy -tokenizer -truetype -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip-external"
www-apache/mod_fcgid-2.2
www-apps/joomla-1.0.13  USE="vhosts" 0 kB
Comment 1 Gerd Burmann 2007-09-21 12:39:25 UTC
Portage 2.1.3.9 (hardened/amd64, gcc-3.4.6, glibc-2.5-r4, 2.6.20-hardened-r6 x86_64)
=================================================================
System uname: 2.6.20-hardened-r6 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Timestamp of tree: Fri, 21 Sep 2007 04:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.10
sys-devel/binutils:  2.17-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /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"
CXXFLAGS="-O2 -march=k8 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LINGUAS="de"
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 --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip amd64 apache2 berkdb bzip2 cgi cli contentcache cracklib crypt ctype discard-path erandom fastcgi force-cgi-redirect gcc64 gd glibc-omitfp gpm hardened inode ithreads java java5 justify ldap ldap-sasl memlimit midi mpm-worker mysql mysqli ncurses nls nptl nptlonly odbc pam pcre perl php pic postfix python readline session sharedext slang sockets sse sse2 ssl syslog tcpd threads unicode urandom vhosts xml zip zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-09-21 15:52:34 UTC
This has nothing to do with hardened.
Comment 3 Christian Hoffmann (RETIRED) gentoo-dev 2007-09-21 18:31:31 UTC
This is really strange.
  * php-5.2.4_p20070914 should be pretty similar to 5.2.2 and 5.2.3 regarding to *CGI behaviour
  * php-5.2.4 (final) is known to be broken regarding symlink handling, that's why I reported an upstream bug [1] for that
  * php-5.2.4_p20070914 is supposed to contain the fix (committed on Sep 10th for the problem

So, please make sure you are really using php-5.2.4_p20070914* (and not 5.2.4 final). Then try to provide a very simple test case which shows the problem (using var_dump($_SERVER) or something along the lines). If this is reproducible using an up-to-date upstream snapshot [2] (please compile from source and disable all unnecessary extensions, ./configure --disable-all ... is a good idea), then I'd ask you to file an upstream bug [3] and link it here.
I assume that the redirect does not come from PHP but from Joomla because of some strange value in $_SERVER (I'd suspect SCRIPT_NAME).

Not much we can do about, but when there's a patch from upstream we'll happily include it in our next revision.

[1] http://bugs.php.net/bug.php?id=42587
[2] http://snaps.php.net/
[3] http://bugs.php.net/
Comment 4 Christian Hoffmann (RETIRED) gentoo-dev 2007-09-21 19:09:12 UTC
I did some testing and were not able to reproduce it:
php-5.2.3 (vanilla), php-5.2.4_p20070914-r2 (Gentoo) and php5.2-200709211830 all behave the same (when comparing var_dump($_SERVER)). Only php-5.2.4 (vanilla) fails (SCRIPT_FILENAME=$SYMLINK_TARGET and CWD=$(dirname $SYMLINK_TARGET) -- but that's expected).
Looking at Joomla code, the redirect code only makes the assumption that the config file is in the current directory. When requesting /, the current directory is the docroot (let's assume /var/www/), while your Joomla installation is in /joomla (filesystem: /var/www/joomla) -- so Joomla doesn't find its config file and redirects to the installation page.
Now I'm asking myself -- why could that ever have worked? If I didn't miss something, Joomla assumes the behaviour which php-5.2.4 has (and only php-5.2.4, no other versions)...
Comment 5 Gerd Burmann 2007-09-21 20:11:57 UTC
Thank you for your help. Somehow it worked with the old version. I now use an alias statement in the apache config. It works.