I'm working on script that will use txt files instead of db. Problem is that I have to chmod txt every time I make it. On same servers there are restrictins in php for chmod command. Is there any solution to solve this? Any idea?
Try using PHP to CHMOD it, with the error silence operator @. Then use is_writable() to check if it worked. If not, throw an error and tell the user to CHMOD it manually. Also CHMODing the directory you're working in before might help.
yes yes. there are no solution. maybe to generate new php.ini with only one line that remove chmod restriction ??
Here is what you can do. Ask the user to create a directory in mode 777 and then you should be able to chmod files in that folder via PHP. Peace,
Jim is right you can proceed with Jim. exec ('chmod -R 777 your site document root address/filename for permission');
if you chmod the folder with the right permissions you shouldn't need to chmod the files to be able to create/write to them you might want to change owners (chown) to the http server's username
is it possible first to check is that command aloved? script must work on all servers.i don't want users to see errors.
It depends on the security settings in php.ini. As long as safe_mode isn't enabled, it will definitely work.