Fopen() Fails to work on Remote Server

I have a script that works on my local server but fails on the remote. The remote is https, however I have not been able to find any docs to give direction. I have changed the a+ to w or a, file.

Anyone be able to point me in the right direction?

Thank you


$cf = $_POST['cf'];
$myfile = 'myfile.txt';
$gbs = fopen($myfile, 'a+');
fwrite($gbs, $cf);
echo 'This is contents of readfile:'; //for debugging
echo '<br />';

if (file_exists($myfile)) {
    echo "The file $myfile exists";
} else {
    echo "The file $myfile does not exist";

Issue solved, it was a permission set on the server…