PHPcode $ resfopen (usrlocalasgconfigsmeet. conf, a +); fclose ($ res); if meet. if the conf file does not exist, you can create it, but it cannot be created on the server. you can run the ls command to check that there is no write permission. Therefore, you have added the judgment & nbsp; PHPc php permission to create files on the server
PHP code
$res = fopen('/usr/local/asg/configs/meet.conf','a+');fclose($res);
If the meet. conf file does not exist on the local machine, it can be created, but it cannot be created on the server. you can run the ls command to check that there is no writable permission. Therefore, you have added a judgment in the code.
PHP code
if(!is_writable('/usr/local/asg/configs')) { system('chmod 777 /usr/local/asg/configs');}$res = fopen('/usr/local/asg/configs/meet.conf','a+');fclose($res);
After running, it cannot be created again.
PHP code
if(!is_writable('/usr/local/asg/configs')) { system('chmod 777 /usr/local/asg/configs');}system('touch /usr/local/asg/configs/meet.conf');
Run it, but it still doesn't work. use putty to log on to the server, use the command line to enter the directory, and directly use touch to create the directory, why is the php file unsuccessful ???
------ Solution --------------------
I think you can use the php function chmod to complete this operation.
In addition, you must grant this directory permission to the php running account.
------ Solution --------------------
If (! Is_dir ('/usr/local/asg/configs ')){
Mkdir ('/usr/local/asg/configs ');
Chmod ('/usr/local/asg/configs', 0777 );
}
------ Solution --------------------
How can I use php to assign directories without permissions?
Just like if you do not have the permission to enter the State Council, then you cannot dress up unless you look for a relationship.