Read-Only Filesystem Error in PHP
I’m getting the following error in when running some web server php:
failed to open stream: Read-only filesystem
The lines I have narrowed it down to are:
$file = fopen($_POST["slug"]."/index.html", "w"); echo fwrite($file, "<!DOCTYPE html><html><head><title>URL Shortener ig</title><meta charset='UTF-8'></head><body><script>window.location=".$_POST["url"]."</script></body>"); fclose($file);
Basically it needs to write to a html file to make a redirect for a specific slug on a url shortener.
This is my first php project.
From what I understand it is because the computer is protecting its files, but how can I fix this on replit? Is there a shell command or something?
Any help would be appreciated, thanks.