|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-21 17:59 UTC] jani@php.net
[2009-09-24 12:18 UTC] l dot mauri at neopost dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 10 03:00:01 2025 UTC |
Description: ------------ Hello everyone, I have a problem with my installation of PHP 5.2.11 (please see my configuration below) I'm using require_once to include twice the same file. In one case I'm including the file based on its relative path and in other case I'm including it with its absolute path. When I use the php client in command line, it works fine. I only have the problem using Apache server. I figured out that realpath can't resolve the relative path: <?php print realpath("./file2.php") . "\n"; ==> FALSE print realpath("/absolute/path/to/file2.php') . "\n"; ==> / absolute/path/to/file2.php ?> Thank you in advance ---------------------------------------------------------------- Configuration: SunOS devs0004 5.10 Generic_137137-09 sun4u sparc SUNW,Sun-Fire-V240 64-bit sparcv9 kernel modules PHP 5.2.11 Configure Command => './configure' '--with-libxml-dir=/usr/local' '-- with-mysql=/usr/local/mysql5136/' '--enable-track-vars' '--enable- libgcc' '--enable-trans-sid' '--enable-ftp' '--enable-pcntl' '--enable- sockets' '--enable-soap' '--with-apxs=/usr/apache/bin/apxs' '--with- zlib-dir=/usr/local/lib' '--with-pdo-mysql=/usr/local/mysql5136' '-- with-mcrypt=/usr/local/bin' '--enable-debug' $ file /usr/local/bin/php /usr/local/bin/php: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped $ file /usr/apache/libexec/libphp5.so /usr/apache/libexec/libphp5.so: ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked, not stripped Apache 1.3.41 Reproduce code: --------------- file1.php <?php require_once('./file2.php'); require_once('/absolute/path/to/file2.php'); $a = new A(); ?> ---------------------------------------------------------------- file2.php <?php class A { public function foo() { echo 'Foo'; } } ?> Expected result: ---------------- The second call to require_once does not include the file. Actual result: -------------- PHP raise a Fatal Error : "Fatal error: Cannot redeclare class"