Want to edit a sh file using php code

view story

http://www.unix.com – Hi friends, I want to edit sh file using php, i have tried different method. but its shows permission issues. Folder path : xyz permission :0755 owner: 545 group: 0 filename : abc.sh permission :0644 owner:0 group: 0 how to edit these files using php/ i have use below codes, but not got any success Code: $file =$_SERVER['DOCUMENT_ROOT']."xyz/abc.sh"; chmod($file,0777); exec('chown 545 $file'); exec('chmod 755 $file'); (HowTos)