GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP question (https://gfy.com/showthread.php?t=933453)

marcjacob 10-15-2009 07:27 AM

PHP question
 
I'm using mkdir() to create folders but I can't then delete the folder. The permissions are set to 745 but I thought mkdir() would also chmod?

I'm using:

mkdir($make, 0777);

Any idea why?

Killswitch - BANNED FOR LIFE 10-15-2009 07:29 AM

www.php.net/mkdir

marcjacob 10-15-2009 07:31 AM

That's what I've done, unless you mean to make it reccursive?

Babaganoosh 10-15-2009 07:38 AM

Note: When safe mode is enabled, PHP checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed.

AIbenjamink 10-15-2009 08:15 AM

Are you trying to remove directories which contain files? Are you trying to remove with PHP or via FTP?

woj 10-15-2009 08:21 AM

The folder created is owned by the "apache" user, no matter what permissions you change to you won't be able to delete it with your ftp user... (without tweaking server settings elsewhere)

marcjacob 10-15-2009 08:33 AM

Woj can I use chown() to change ownership to my ftp login?

marcjacob 10-15-2009 08:53 AM

chown() didn't work but mkdir($make, 0777); chmod($make, 0777); made directories deletable through ftp. Odd.

beta-tester 10-15-2009 09:12 AM

you will need to umask the user and then revert it in order to delete folders made by php.

borked 10-15-2009 09:26 AM

Quote:

Originally Posted by marcjacob (Post 16430576)
The permissions are set to 745 but I thought mkdir() would also chmod?

Yes it will, unless this is a Windows machine...:winkwink:


All times are GMT -7. The time now is 08:11 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123