Often times I will download the ticker file (that's what this is) and edit it offline. Then I'll upload it. This is what changed. Previously our ticker writer did what is was supposed to and on our Plkesk server the file was owned by siteadmin and psacln.
Something changed and we don't know what. Regardless of being created by a script indirectly run by another script the file was not owned by apache. But now that something has changed I can download the file but not upload it back.
I tried using chown and chmod from PHP but it fails.
<?php
if (file_exists('test.txt'))
{
unlink('test.txt'); // if it already exists let's erase it as a workaround
}
$fp = fopen('test.txt', 'w') or die("Unable to open file.");
fwrite($fp, strftime('%c')."\r\n");
fclose($fp);
chown('test.txt', 'scannerbuff');
?>
or
<?php
if (file_exists('test.txt'))
{
chown('test.txt', 'siteadmin');
}
$fp = fopen('test.txt', 'w') or die("Unable to open file.");
fwrite($fp, strftime('%c')."\r\n");
fclose($fp);
chown('test.txt', 'siteadmin');
?>
What is another way I can change ownership to siteadmin?