Skip to content
Advertisement

tempnam() not working on client server

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:

JavaScript

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

I used this code:

JavaScript

Advertisement

Answer

I found the issue. Since my hoster does not like the /tmp directory ( who would blame them ) i need to first set putenv(‘TMPDIR=/the tmp-dir my provider gave me’); which then works with tempname

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement