Let's approach this differently: if a script can be run as the user in SSH just fine, what condition would keep the script from running from a browser? File permissions? Folder permissions? User permissions?
This is the test code:
Code: Select all
<?php
unlink('test.txt');
$fp = fopen('test.txt', 'w');
$date = strftime('%c');
fwrite($fp, $date);
fclose($fp);
?>
Code: Select all
[client 70.84.230.166] PHP Warning: fopen(test.txt): failed to open stream: Permission denied in /var/www/vhosts/scannerbuff.net/httpdocs/ticker/test.php on line 3
[client 70.84.230.166] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/scannerbuff.net/httpdocs/ticker/test.php on line 5
[client 70.84.230.166] PHP Warning: fclose(): supplied argument is not a valid stream resource in /var/www/vhosts/scannerbuff.net/httpdocs/ticker/test.php on line 6