I'm quite new to Linux so please excuse my ignorance, and accept my apology for what is likely a very lame question.
I have setup a Centos 6.4 server and also installed LAMP, phpmyadmin, mod_ssl and vim.
This server is to host a single website only, but I have set it up as a virtuial site per what appears to be a best prcatice.
This site will have its content uploaded via SFTP by a 3rd party, and this has been tested to work OK.
I have found that simple PHP seems to work OK, so as the following script (named info.php) works OK:
<?php
phpinfo();
?>
This correctly shows the PHP versioning when I browse to mysite/info.php.
However, I've created the following simple PHP (named test.php) to write a text file:
<?php
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "TEST1\n";
fwrite($fh, $stringData);
$stringData = "TEST2\n";
fwrite($fh, $stringData);
fclose($fh);
?>
When I browse to mysite/test.php, the page displayed is the text value can't open file, which appears to come from the or die statement.
My issue is that I am unaware of why these scripts refuse to run.
Any help will be most appreciated.
Cheers,
Ben