Re: Strange behavior on backtick operator execution environment

From: Date: Thu, 16 Jan 2003 17:51:23 +0000
Subject: Re: Strange behavior on backtick operator execution environment
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-131906@lists.php.net to get a copy of this message
On Friday 17 January 2003 01:37, Marc Cluet wrote: > Hi guys > I have upgraded from PHP 4.2.2 to PHP 4.3.0 and some of my php script > got broken due to that. > This scripts use backticks to execute functions, the problem is the > environment where that functions are executed. > > I have this test code: > <?php > $dir=pwd; > echo "I am on directory: $dir"; > ?> > > If I execute this code using PHP 4.2.2 I get this result: > > root@test:/root# php /var/www/html/test.php > I am on directory: /var/www/html > > If I execute this code using PHP 4.3.0 I get this different result: > root@test:/root# php /var/www/html/test.php > I am on directory: /root > > I have not touched php.ini from one version to the other (I'm still > using my one), I'm with safe_mode = Off so it should not affect this. > > Anybody have a clue about if this is a bug or is a feature of the new > version? I'm really confused about it. You're probably using the CLI version of PHP (which is built by default starting with 4.3) as opposed to the earlier CGI versions. manual > "Using PHP from the command line" tells you the differences between CLI and CGI, one of them being "it does not change the working directory to that of the script". -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Can you buy friendship? You not only can, you must. It's the only way to obtain friends. Everything worthwhile has a price. -- Robert J. Ringer */

« previous php.general (#131906) next »