George
George

Reputation: 1

dealing with files in php

I am creating a file with php. I just want to be able to create it, with no content, under a directory. Then I want to be able to edit it when I access my server with ftp. I can't! The user of php is different from the ftp user, and this last one does not have permissions to change it! I tried chmod,umask,chown, but nothing works. Anybody knows how to do it? Thanks

Cheers

Upvotes: 0

Views: 133

Answers (2)

knittl
knittl

Reputation: 265131

Give your file world writeable permissions chmod('filename', 0666)

Upvotes: 0

cletus
cletus

Reputation: 625007

In PHP, after you move or otherwise create the file, just change it's permissions using chmod():

chmod($file, 0666);

Don't give execute permissions (which 0777 would) otherwise someone on the system can execute it. Huge security vulnerability.

Upvotes: 3

Related Questions