CodeIgniter Forums
File Editing and Permissions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: File Editing and Permissions (/thread-13868.html)



File Editing and Permissions - El Forum - 12-09-2008

[eluser]Eric Cope[/eluser]
I am creating an install script that needs to edit CI config files. Below are the steps
1) User FTPs all files to server
2) User browses to install script and enters all user data
3) PHP script edits CI config files, updates database, deletes install files

I want to automate 2 and 3. the problem is that the files are uploaded using the user's account, not Apache's. To edit the files, Apache needs r+w access.

Any ideas, other than granting write access to the world?


File Editing and Permissions - El Forum - 12-09-2008

[eluser]Phil Sturgeon[/eluser]
Can you not give Apache access temporarily using chown() and chmod()?


File Editing and Permissions - El Forum - 12-09-2008

[eluser]Eric Cope[/eluser]
I think I will have to require the end user to chmod it to allow Apache to write it. I didn't want to do that, but I guess I will have to.


File Editing and Permissions - El Forum - 12-09-2008

[eluser]Phil Sturgeon[/eluser]
Can you explain the upload process a little more? Sounds to me like a user is uploading the files then going to an install script to enter data.

Why not have an upload field with the data so a user can upload everything at the same time? Then you can use chmod and chown in your PHP script to automatically give Apache the correct perms.


File Editing and Permissions - El Forum - 12-09-2008

[eluser]Eric Cope[/eluser]
i was thinking about having the user upload the installer script which gets the latest version of my software via ftp, so the user doesn't have to deal with it. I am trying to reduce the work done by the user because humans (especially, the ones I deal with) can't be trusted with uploading files.