This script is useful for checking whether PHP can create a file in a specific folder and if the necessary permissions are sufficient for this.
<?php
$ourFileName = "test.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
echo "ok";
?>
Copy this script into a file named test.php, upload it to the website folder, and open it in a browser at yoursite.com/test.php. As a result, a file named test.txt should be created in the folder where the script is, and the message "ok" should appear in the browser.