Saturday 15 March 2014

Giving write permission to PHP on UBUNTU 14, file_put_contents not working -



Giving write permission to PHP on UBUNTU 14, file_put_contents not working -

i have create script runs through crontab. have set new ubuntu in virtual machine , started testing

so realized php not writing files (with file_put_contents) in /var/www/html/ folder when run script in terminal (sudo php filename.php)

if remove sudo command says permission denied. tried create different folder within ../html/ , tried chmod 777. nil seems work. i've seen problem few years ago can't find solution

does of know happening?

check php executable file see if setuid permissions causing php drop superuser privileges you've given sudo.

i know aren't running via web server, benefit of others do, find much scary run php elevated privileges. if need dangerous, isolate little code possible, , code perl script suid root. (no, can't on shared hosting.) pop out perl php. in case, perl automatically runs in taint mode, forcing cleanse inputs before proceeding. (this technique circa 2001, there may improve way now.)

...tom robinson

php ubuntu permissions crontab chmod

No comments:

Post a Comment