How can I create a folder not on the server, but in my computer (Profile/AppData/Local/Fyooz/).
my sample code:
$file = "Profile/AppData/Local/Fyooz/";
if(file_exists($file)) {
echo "file exist";
echo $file;
} else {
mkdir($file, 0777);
}
but it returns an error, because it will open the domain folder not my local computer.
You can only create a folder on your local computer if you’re running your PHP script locally.
If you’re trying to run a PHP script on a webserver and create a folder on the client’s computer, this is not possible (as you already see a lot of other people saying).
Here’s a sample script to try. Save it to
~/myscript.phpOpen a terminal and run your script
You should see output like this
Navigate to
~and you should see your newhelloworldfolder