Пожалуйста, убедитесь, что разрешения / tmp действительно xx777
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$s = stat('/tmp');
printf('%o', $s[2]);
file_put_contents('/tmp/phptest1234.txt', 'test');
unlink('/tmp/phptest1234.txt');
edit: следующая попытка, umask
<?php
echo ' php-umask: ', sprintf('%o', umask()), "\n";
echo ' exec-umask: ', exec('umask'), "\n";