Question

I'm using Mac OSX, and when I try to create a temporary file, I get this message:

$temp_file  =  tmpfile();

Could not create temporary files for attachments. Your tmp directory may be unwritable by PHP

I checked the directory, and here's what I see:

echo sys_get_temp_dir();

ls -ld /var/folders/v1/9BmtDyVv7v15d6qx07_4ylfh0000gn/T
drwx------  41 mark  staff  1394 Feb 21 12:44 /var/folders/v1/9BmtDyVv7v15d6qx07_4ylfh0000gn/T

No correct solution

OTHER TIPS

Are you sure you're mark ?

<?php var_dump(get_current_user()); // will probably display www-data

If, as I guess you are, you're executing this script with a web-server, keep in mind the web server is probably run by another user than you (which is a security best practice), even if the startup script is run by root.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top