授予 777 在 php 中动态创建文件的权限
嗨,我有一个脚本,它在我的本地目录上动态创建了一个文件,请告诉我如何立即向该文件授予777权限,它在浏览器中无法访问
<?php
//Get the file
$content = 'http://xxx.xxx.com.mx/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/b/r/bridal-shoes1.jpg ';
$content1 = explode('/', $content);
$end = end($content1);
echo $end;
//print_r($content1[12]);
//Store in the filesystem.
$my_file = $end;
$handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file); //implicitly creates file
$path = '/var/www/'.$end;
copy($content, $path);
?>