From: freidman at mail dot ru Operating system: Gentoo Linux PHP version: 5.2.0 PHP Bug Type: FTP related Bug description: ftp_rawlist not work with open_basedir
Description: ------------ This is related to bug #32708 There must be a way to set tmp-file creation of this functions, but setting TMPDIR environment variable doesn't work. I don't want to include /tmp dir in open_basedir directories. Reproduce code: --------------- <?php putenv('TMPDIR=/hosting/clients/xxx.com/httpd/tmp'); echo getenv('TMPDIR'); // set up basic connection $conn_id = ftp_connect("xxx.com"); // login with username and password $login_result = ftp_login($conn_id, "xxx", "xxx"); // get the file list for / $buff = ftp_rawlist($conn_id, '/'); // close the connection ftp_close($conn_id); // output the buffer var_dump($buff); ?> Expected result: ---------------- listing of files Actual result: -------------- /hosting/clients/xxx.com/httpd/tmp Warning: ftp_rawlist() [function.ftp-rawlist]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/hosting/clients/xxx.com/httpd:/usr/lib/php:/usr/local/lib/php) in /hosting/clients/xxx.com/httpd/htdocs/a.php on line 15 Warning: ftp_rawlist() [function.ftp-rawlist]: Unable to create temporary file. Check permissions in temporary files directory. in /hosting/clients/xxx.com/httpd/htdocs/a.php on line 15 bool(false) -- Edit bug report at http://bugs.php.net/?id=39555&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39555&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39555&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39555&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39555&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39555&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39555&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39555&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39555&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39555&r=support Expected behavior: http://bugs.php.net/fix.php?id=39555&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39555&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39555&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39555&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39555&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39555&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39555&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39555&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39555&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39555&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39555&r=mysqlcfg