문제

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

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top