|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-06-21 16:16 UTC] programatorfreez at gmail dot com
Description:
------------
Hello,
In PHP <= 5.2.2 realpath('.") will return realpath to current working directory (for example /var/www/localhost/htdocs/mypages) but in PHP 5.2.3 function realpath('.') causes openbase_dir restriction related error.
Reason
======
echo realpath('/var/www/localhost/htdocs/mypages/'); in PHP <= 5.2.2 works, but in PHP 5.2.3 causes openbase_dir restriction error with something like "You have not access to /var/www/localhost/htdocs/mypages' (it's because the final slash is missing) the openbase_dir in php.ini is set to "/var/www/localhost/htdocs/mypages/", function realpath will cut the final slash and this will lead to error.
Reproduce code:
---------------
<?php
echo 'It's described above =)';
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Actually i'm happy that my PHP 5.2.2 is working and unfortunatelly i don't have enough time to compile CVS version and then stable again. I'll wait until it will be in Gentoo portage, it's the best way for me. Do you have installed CVS version? If so, please try: ----------------------------- <?php echo realpath('./'); ?> ----------------------------- The directory with script must be in php.ini -> open_basedir, don't forget to add the final slash. Safe mode must be on. The result with PHP 5.2.2 is something like /var/www/localhost/htdocs/mypages. With PHP 5.2.3 the result is similar to open_basedir restriction in affect, directory /var/www/localhost/htdocs/mypages is not in allowed path. PHP 5.2.3 is actually running only on webhosting, where are stored my pages. Thanks for a try