Linux Laravel和Xampp权限问题
我对Linux(Mint)相当陌生,我已经安装了xampp并克隆了我的Git repo 问题是我没有访问这些文件的权限,所以我运行了Linux Laravel和Xampp权限问题,linux,laravel,permissions,xampp,Linux,Laravel,Permissions,Xampp,我对Linux(Mint)相当陌生,我已经安装了xampp并克隆了我的Git repo 问题是我没有访问这些文件的权限,所以我运行了chmod755,但任何新文件都有相同的问题 错误消息: 无法打开流:权限被拒绝 我想知道我是否安装了xampp不正确,或者在运行php artisan migrate或composer update等命令时使用sudo是否会导致我的用户无法访问这些文件 这是怎么回事?步骤1:检查根目录: sudo chown -R www-data:www-data /path/
chmod755
,但任何新文件都有相同的问题
错误消息:
无法打开流:权限被拒绝
我想知道我是否安装了xampp不正确,或者在运行php artisan migrate
或composer update
等命令时使用sudo
是否会导致我的用户无法访问这些文件
这是怎么回事?步骤1:检查根目录:
sudo chown -R www-data:www-data /path/to/root
步骤2:为上传和处理文件授予FTP(用于使用任何FTP客户端):
步骤3:将文件权限设置为644:
sudo find /path/to/root -type f -exec chmod 644 {} \;
步骤4:将目录权限设置为755:
sudo find /path/to/root -type d -exec chmod 755 {} \;
步骤5:授予web服务器读写存储和缓存的权限
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
参考资料:尝试放置
chmod 777
@Alexander Villalobos,这会有什么不同,因为7只是添加了excu许可?777获得此项目的所有许可777确实有效,但我需要为未来的每个laravel项目都这样做,我不想在其上线时授予此类许可。没有办法一劳永逸地解决这个问题吗?在系统文件夹中停止运行cmd,并将此命令放到sudo chmod 744-R中,您的问题就解决了。从技术上讲,这不是我需要的答案,但在项目上线时,这不是一个不太好的答案。谢谢+1.
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache