Hi,
I found another strange behaviour in PHP5, it occurred only on my
Windows machine using the Apache SAPI (tried it on Debian with PHP-CGI
and it worked fine).
The following code:
<?php
class Foo
{
public function __construct()
{
echo realpath('./') . "\n";
}
public function __destruct()
{
echo realpath('./') . "\n";
}
}
$foo = new Foo();
?>
returns:
c:\www\projects\pat\patportal\examples
c:\programme\apache group\Apache
Best regards,
Stephan
http://www.php-tools.net
http://www.schst.net
http://pear.php.net
Hi Stephan,
this is by design and was discussed before, please check the archives. And
should happen on Linux with mod_php, too.
johannes
Stephan Schmidt wrote:
Hi,
I found another strange behaviour in PHP5, it occurred only on my
Windows machine using the Apache SAPI (tried it on Debian with PHP-CGI
and it worked fine).The following code:
<?php
class Foo
{
public function __construct()
{
echo realpath('./') . "\n";
}public function __destruct() { echo realpath('./') . "\n"; }
}
$foo = new Foo();
?>returns:
c:\www\projects\pat\patportal\examples
c:\programme\apache group\ApacheBest regards,
Stephan
--
Johannes Schlüter Mayflower GmbH / ThinkPHP
http://thinkphp.de http://blog.thinkphp.de
c:\www\projects\pat\patportal\examples
c:\programme\apache group\Apache
I found similar weirdness. When using the CGI, on my Windows 2000 machine
when doing realpath('.') I get the path to the document root, as expected.
But when doing the same thing on my Windows XP Pro machine, it returns the
path to my PHP installation.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409