Welcome Guest, Not a member yet? Register   Sign In
File Editing and Permissions
#1

[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?
#2

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

[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.
#4

[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.
#5

[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.




Theme © iAndrew 2016 - Forum software by © MyBB