Re: require_once failure

From: Date: Thu, 25 Jun 2009 12:43:32 +0000
Subject: Re: require_once failure
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-294575@lists.php.net to get a copy of this message
ste.paoletti@tiscali.it wrote:
Hi all, I'm a php programmer an I found an anomaly.. it could be a bug. On Mac Os all goes right but on debian enviroment there are some problems: Suppose I've the file /home/ste/test.php containing the following line: <?php set_include_path('/usr/share/php'); require_once 'PHPUnit/Extensions/Database/Testcase.php'; also suppose that file /usr/share/php/PHPUnit/Extensions/Database/Testcase.php really exist. If I open a shell and runs the script I've the following fatal error: ste@debian:~$ php -v PHP 5.2.6-1+lenny2 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 26 2009 22:41:04) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with Zend Debugger v5.2.15, Copyright (c) 1999-2008, by Zend Technologies ste@debian:~$ php test.php Warning: require_once (PHPUnit/Extensions/Database/Testcase.php): failed to open stream: No such file or directory in /home/ste/test.php on line 3 Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Database/Testcase.php' (include_path='/usr/share/php') in /home/ste/ste.php on line 3 Someone can help me? Why on Mac Os there are no problems? Thanks all
Are you sure it isn't in /usr/share/pear ?? I don't know Debian's layout, but CentOS/Fedora put pear stuff in /usr/share/pear - NOT /usr/share/php I bet if you comment out the explicit setting if the include path it would work, the path to pear is usually in the default include path defined in the php.ini file on Linux installs.

« previous php.general (#294575) next »