Symfony如何删除文件 [英] Symfony How To Remove A File

查看:107
本文介绍了Symfony如何删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不能在Symfony中使用unlink()?



我已经试过了:

  unlink(/ Applications / XAMPP /xamppfiles/htdocs/symfonydev/web/account_assets/data/suppliers/file.txt)

我保留获取相同的响应:警告:取消链接(/Applications/XAMPP/xamppfiles/htdocs/symfonydev/web/account_assets/data/suppliers/wordpress.txt):权限被拒绝...



我需要做什么?

我已经在这个文件上设置了777的权限。

解决方案

这是包含文件的主目录上的权限问题。一旦我改变了所有者和权限,一切运作良好。文件系统组件工作真棒!


Why cant I use unlink() in Symfony?

I have tried this:

unlink(/Applications/XAMPP/xamppfiles/htdocs/symfonydev/web/account_assets/data/suppliers/file.txt)

I keep getting the same reponse: Warning: unlink(/Applications/XAMPP/xamppfiles/htdocs/symfonydev/web/account_assets/data/suppliers/wordpress.txt): Permission denied in...

What Do I need to do???

I have set the permissions to 777 on this file.

解决方案

It was a permissions issue on main directory that contained the files. Once I changed the owner and permissions, all worked well. The filesystem component works awesome!

这篇关于Symfony如何删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆