php unable to create folders

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

php unable to create folders

Post by aneuryzma »

hi,

I'm using Drupal and it seems that it cannot create the "files" folder.

I tried to upload a php script with mkdir("files",774) but I get a permissions error, so basically any php script on the server is not able to create a folder on the server... I guess this is the problem.

What do you suggest ? If I create the folder manually from ftp client and I assign 777 permission everything works perfectly, but it is not safe solution.

thanks
M2tM
Forum Commoner
Posts: 41
Joined: Sat Feb 27, 2010 12:35 pm

Re: php unable to create folders

Post by M2tM »

People say setting things to 777 is not a safe solution, but that said, it just indicates which users can modify things. The person still has to get access to your server or be able to run an arbitrary script in order to actually do anything in the first place, so generally it isn't actually "unsafe" in most situations.
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

Re: php unable to create folders

Post by aneuryzma »

ok cool, thanks
Post Reply