Reputation: 753
Sorry in advance if it is a newbie question, but I am trying to make a file on my desktop with php.
The following script does not work. Any idea what is wrong? I have defined the path (which is my desktop) and the name of the file.
<?php
mkdir('/Users/mary/Desktop', "test", 0777, true);
?>
Upvotes: 0
Views: 85
Reputation: 315
Can you try here i mentioned code.
mkdir('/Users/mary/Desktop/test', 0777, true);
Upvotes: 0
Reputation: 23409
PHP does not have access to write to your desktop. You would need to chmod
your desktop. Open a terminal and do: sudo chmod 777 $HOME/Desktop
That's for Linux/Mac, if you're on Windows it depends on the version.
Upvotes: 2