Server doesn't allow chmod with PHP!

See all posts Reply

Server doesn't allow chmod with PHP! new!
by oguz, 13 years, 9 months ago
OK, here is an expertise question for 10 points: I know this upload class uses automatic file permission change and then upload, but the thing is our server does not allow PHP chmod function (I don't know how). To change file permissions you have to connect with FTP. It's OK, because I can use ftp functions in PHP to connect, change file permission to 777, upload files, then change file permissions back to 755. But newly created (by class.upload) directories' owner is not the same user that I connect to server, so, I can NOT chmod new directories to 755.

Any solutions?Reply
Re: Server doesn't allow chmod with PHP! new!
by colin, 13 years, 9 months ago
You will probably need to solve this issue with your hosting company. Generally, on shared hosting, the web server user is the same as your FTP user, and you don't have the problem you describe.

That said, you can change the default chmod mode with the class:
$handle->dir_chmod = 0777;
Reply
Re: Server doesn't allow chmod with PHP! new!
by oguz, 13 years, 9 months ago
Yes, I know, but class.upload logins with different user ID than our admin ID, so that causes a little problem.

But I solved my own problem anyway, instead of letting class.upload to create new directories, I rewrote it, so the FTP connection creates them.

Thank you for your quick reply.Reply
Re: Server doesn't allow chmod with PHP! new!
by Drakkhen, 12 years, 4 months ago
I have the exact same problem, i would be very interested by your solution.Reply
Re: Server doesn't allow chmod with PHP! new!
by breadagast, 10 years, 5 months ago
Hola:
Si posteas tu solución te lo agradecería, yo tengo el mismo problema.Reply