$structure = '/upload';
if (!mkdir($structure, 0, true)) {
die('Failed to create folders...');
}
this is my code, but i m not been able to create directory.it shows me the error Failed to create folders.
$structure = '/upload';
if (!mkdir($structure, 0, true)) {
die('Failed to create folders...');
}
this is my code, but i m not been able to create directory.it shows me the error Failed to create folders.
First ssh to your ec2 instance and change the ownership and permission of your web root folder, assuming your web root folder is located in /var/www/html you can do the following:
The code above will make apache the owner of the web root direction and it's contents
The code above sets the necessary permission for the web root folder and contents, you should edit as needed.
After that run your code you should be able to create the folder.
I don't think you can create folders in the root directory with PHP as it does not have the permission to do that.
However, what you probably could do, is to create a folder in the root directory through an ssh terminal and use that folder for your application
Next, set write permissions to myApp folder
subsequently, you would be able to create your "uploads" folder in /myApp