php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28865 Functions ftp_*list
Submitted: 2004-06-21 09:39 UTC Modified: 2004-07-02 01:00 UTC
Votes:20
Avg. Score:4.4 ± 0.9
Reproduced:19 of 20 (95.0%)
Same Version:10 (52.6%)
Same OS:7 (36.8%)
From: 336764 at 163 dot com Assigned: pollita (profile)
Status: No Feedback Package: FTP related
PHP Version: 5.0.0RC3 OS: MandRake 10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-06-21 09:39 UTC] 336764 at 163 dot com
Description:
------------
Warning: ftp_nlist() [function.ftp-nlist]: Unable to create temporary file. Check permissions in temporary files directory. in /web/browse.inc.php on line 181


Warning: ftp_rawlist() [function.ftp-nlist]: Unable to create temporary file. Check permissions in temporary files directory. in /web/browse.inc.php on line 181



/tmp is chmod 777 and other temporary directory is 777 too.

Reproduce code:
---------------
$rawlist = ftp_rawlist($conn_id, "-a");
$rawlist = ftp_rawlist($conn_id, "");

$rawlist = ftp_nlist($conn_id, "-a");
$rawlist = ftp_nlist($conn_id, "");

Expected result:
----------------
Warning: ftp_nlist() [function.ftp-nlist]: Unable to create temporary file. Check permissions in temporary files directory. /web/browse.inc.php on line 181



Actual result:
--------------
list all files to array.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-21 17:59 UTC] pollita@php.net
What does the ouput of this show?

var_dump(tmpfile());
 [2004-06-23 03:21 UTC] 336764 at 163 dot com
bool(false)
 [2004-06-23 03:37 UTC] 336764 at 163 dot com
PHP5 Environment variable:
TMPDIR is /root/tmp  

How to change it ?
 [2004-06-23 12:04 UTC] 336764 at 163 dot com
vi /root/.bashrc

Add "TMPDIR=/tmp" 

save & exit;

Restart httpd

run php:
var_dump(tmpfile());

get:
resource(2) of type (stream)
 [2004-06-24 02:15 UTC] pollita@php.net
Now that you've changed your environment variable settings, and gotten tmpfile() to work, do ftp_nlist() and/or ftp_rawlist() work as expected?
 [2004-07-02 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2004-07-22 09:20 UTC] flagman_ at rambler dot ru
In php ver. 4.3.8 the temporary file have creates with chmod 600 and belongs to root, in that case apache can`t operate on that file and reports: 

Warning: ftp_rawlist(): Unable to create temporary file. Check permissions in temporary files directory
 [2004-11-08 11:04 UTC] p1pp0 at email dot it
ftp_rawlist ($conn_id, ftp_pwd($conn_id))


Warning: ftp_rawlist(): Unable to create temporary file. Check
permissions in temporary files directory
 [2005-09-06 01:02 UTC] sugeeth7180 at yahoo dot com
Hi 

 I used ftp_nlist to list the contents of a directory.It is working well in one server while it doesn't gave an out put in another server.Could you please suggest a solution

Sugeeth
 [2006-11-21 18:38 UTC] rezeptdb at mhennicke dot de
Hello PHP-bug-Crew,

the bug from function ftp_nlist() is in PHP5.2.0 always still present.

If I set permissions on /tmp to 777, and the safemod open_basedir restriction is in effect, PHP is blocking access by using ftp_nlist().


For fixing the problem, I be very happy.

Best Regards
rezeptdb
 [2007-01-31 05:58 UTC] rathos at rathos dot net
You can set the TMPDIR value with the putenv().

Example:
putenv("TMPDIR=/path/to/public_html/tmp");

Be sure to put it back to what it was before if you are on a shared server environment.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jan 27 08:01:25 2020 UTC