我如何(或可以)更改以下php script
,以便在创建新文件时,它会为文件r/w
提供权限?
<?php
if(isset($_GET['data'])) {
$data = $_GET['data'] . "\n";
$ip = $_GET['ip'];
$ret = file_put_contents('/opt/tomcat7/webapps/servlets/WEB-INF/logs/' . $ip, $data, LOCK_EX);
if($ret === false) {
die('There was an error writing the lab data file');
}
else {
echo "$ret bytes written to file";
}
}
else {
die('no data to process');
}
?>