tempname() not working on client server
<p>I did a script, which has to load a file from a ftp-server then parses it. The code relies on tempname to store the temporarily store the ftp-file. On my developement server (with php  5.3.10), this works flawlessly, however on the client machine (with php 5.2.17) it does not and gives me:</p>

<pre><code>Warning: ftp_rawlist() [function.ftp-rawlist]: Unable to create temporary file. Check permissions in temporary files directory.
</code></pre>

<p>Can someone give me a clue what i could do?
(I am a little weak on the possibiities of php)</p>

<p>I used this code:</p>

<pre><code>define ("LOCALFILE",tempnam('/tmp', 'data-'));
define ("USER","myusername");
define ("PASS","mypassword");
define('SERVER', "ftpserver.com");
define ("DIR","/path/");

function getFTPFile(){

    // connect
    if(!($conn_id = @ftp_connect(SERVER))){
        Error::throwOne("Could not connect to ".SERVER);

    };
    // login 
    if(!($login_result = @ftp_login($conn_id, USER, PASS))){
        Error::throwOne("LOGIN INCORRECT! user:".USER." pass:".PASS);
    };
    // try to change the directory to somedir
    if (!ftp_chdir($conn_id, DIR)) {
        Error::throwOne("Couldn't change directory\n");
    }; 

    if(!($a = ftp_rawlist($conn_id, '-1t'))){
        Error::throwOne("Couldn't get ftp_rawlist\n");
    };

    $server_file=($a[0]);
    if (!ftp_get($conn_id, LOCALFILE, $server_file, FTP_BINARY)) {
        Error::throwOne("Couldn't get file\n");
    };
    ftp_close($conn_id);    
};
</code></pre>
