linux - php unwritable for the file under /etc -
linux - php unwritable for the file under /etc -
i want write script config centos network config file!but had no permission write these config files(/etc/sysconfig/network-script/ifcfg-eth0)!even gave whole etc dir 777 permission.but didn't work!
chmod -r 777 /etc
the php scirpt test file readable or writeable:
$file = "/etc/sysconfig/network-scripts/ifcfg-eth0"; $link = fopen($file,"r+"); echo $file,is_readable($file)?"yes":"no<br>"; echo $file,is_writable($file)?"yes":"no<br>";
the result unreadable , unwritable:
/etc/sysconfig/network-scripts/ifcfg-eth0yes /etc/sysconfig/network-scripts/ifcfg-eth0no
who can give me suggesion!
your file info may cached. seek running script work. (see the php documentation more info.)
<?php clearstatcache(); ?>
if doesn't work, you'll need tell result of stat /etc/sysconfig/network-scripts/ifcfg-eth0
in shell.
never run chmod -r 777 /etc
. @ best, may cause problems programs expecting permissions. in worst case scenario, entire scheme compromised hacker, , may have been. consider using fresh installation of operating scheme rather continuing utilize server.
php linux
Comments
Post a Comment