
I've searched for a solution for awhile now. I made sure all the permissions were set correctly and I also made sure that the paths in /var/www/tmp were correct.
Any ideas? Thanks!
<?php
echo __FILE__;
?>
<?php
if (DIRECTORY_SEPARATOR=='/')
$absolute_path = dirname(__FILE__).'/';
else
$absolute_path = str_replace('\\', '/', dirname(__FILE__)).'/';
echo "Absolute path to this file: {$absolute_path}<br><br>";
?>
/home/wwwwebsitename/public_html/tmp
/home/username/public_html/tmp
<?php
$file = 'test.txt';
$content .= "Testing write permission\n";
if(file_put_contents($file, $content)) {
echo 'File created succesfully';
} else {
echo 'File cannot be created, check permissions';
}
?>