php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #21748 ftp_chmod() needed to create a dir and chmod it 777 if SAFE_MODE is ENABLED
Submitted: 2003-01-19 08:49 UTC Modified: 2003-01-26 20:54 UTC
From: jax at dreamlab dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.0 OS: GNU/Linux
Private report: No CVE-ID: None
 [2003-01-19 08:49 UTC] jax at dreamlab dot net
It is impossible to create a dir and make it chmod 777 when SAFE_MODE is ENABLED. This is needed when you would like to create a directory for image uploading for example... like the admin of a site creates a new model in the CMS, and then a new dir should be created for the model, so the images arent stored in 1 dir. Ok i've thought of putting binary in the database.. but this can't be used when using Macromedia FlashMX because the output must be all paths of the files and not many images on one page :)

i Checked "Description Possible Solution 
Bug #214: mode for chmod is in decimal instead of octal 
chmod("foo", 777) treats 777 as a decimal number, which forces you to do octal-decimal conversion. It's doing it with mkdir() as well. This is the correct behavior. If you want it

to operate on an octal number, give it an

octal number:



chmod("foo", 0777);

 
Bug #3571: Missing Features in the FTP functions." next to it it says: Looks like it was added. Thanks to whomever did so.
but i do not see the function ftp_chmod() anywhere in the ftp_functions...

i.e ftp_chmod() would be needed, eventhough chmod isnt defined in the RFC of FTP... 

Gabe Jackson

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-26 20:54 UTC] pollita@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

ftp_chmod() has been added, look for it in PHP5
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 16 02:00:03 2025 UTC