Peter Vogt
Peter Vogt

Reputation: 373

php set temp directory

Is it possible to change the value that the function sys_get_temp_dir() returns?

My problem is that I don't have write permissions to that directory ( /tmp ) and I can't change that.

Thanks

Upvotes: 3

Views: 16418

Answers (1)

Progrock
Progrock

Reputation: 7485

You can use an environmental variable:

<?php
putenv('TMPDIR=/foo/bar');
echo sys_get_temp_dir(); // Outputs: /foo/bar

Upvotes: 8

Related Questions