I'm developing some php software that will be installed on several remote machines.
The php software on these remote machines will periodically (every month or so) connect to a master server to check for updates.
Most of these updates will be coordinated by placing new data in the MySQL database.
However, I may want to eventually make some major remote updates that involve changing the php files themselves. Any thoughts on how to most securely and effectively do this?
I suppose I could chmod all the php files, but I feel that would be a bad idea for some obvious reasons. 🙂
Another idea I've had is to chmod one "master" php file, then allow the "master" php file to execute script that will temporarily chmod all the other files that need updating, write to them, then modify the chmod again to being non-writable.
Number one: Is this a good idea, or does it still present obvious security problems?
Number two: It sounds like a decent idea to me, but is it even possible to do this? Can you chmod files through other php files? I know there are php chmod functions, but do they work effectively on most unix/linus servers?
Any help would be greatly appreciated.