php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41174 ftp_rawlist not work with open_basedir
Submitted: 2007-04-24 07:34 UTC Modified: 2007-06-21 22:09 UTC
From: valqk at lozenetz dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.1 OS: FreeBSD 6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: valqk at lozenetz dot net
New email:
PHP Version: OS:

 

 [2007-04-24 07:34 UTC] valqk at lozenetz dot net
Description:
------------
I've found a bug report like this but it was with state closed.
This _is_ a bug or at least a lack of features.

There must be a way to set tmp-file creation of this functions, but
setting TMPDIR environment variable doesn't work each time. I don't want to
include /tmp dir in open_basedir directories.

Reproduce code:
---------------
<?php
putenv('TMPDIR=/home/vhosts/test.com/httpd/tmp');
echo getenv('TMPDIR');
$cnid = ftp_connect("example.com");
$login_result = ftp_login($cnid, "user", "pass");
$out = ftp_rawlist($cnid, '/');
ftp_close($cnid);
print_r($out);
?>

Expected result:
----------------
listing of files


Actual result:
--------------
/home/vhosts/test.com/httpd/tmp
Warning: ftp_rawlist() [function.ftp-rawlist]: open_basedir restriction
in effect. File(/tmp) is not within the allowed path(s):
(/home/vhosts/test.com/httpd/tmp:/usr/lib/php:/usr/local/lib/php) in
/home/vhosts/test.com/httpd/tmphtdocs/a.php on line 15

Warning: ftp_rawlist() [function.ftp-rawlist]: Unable to create
temporary file. Check permissions in temporary files directory. in
/home/vhosts/test.com/httpd/htdocs/a.php on line 15
bool(false) 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-21 22:09 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Sep 09 03:00:01 2025 UTC