嗨,我有一个脚本,它在我的本地目录上动态创建了一个文件请告诉我,我现在如何授予该文件 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);
?>