簡體   English   中英

更新,從php腳本ubuntu復制文件

[英]Update, copy file from php script ubuntu

我有由php語言開發的freeradius管理系統,我想將freeradius文件夾中的file1復制到同一文件夾中的file2中,但是即使我對www-data設置了權限,我也無法做到這一點,我使用此代碼復制文件

exec('cp /etc/freeradius/modules/file1  /etc/freeradius/modules/file2');

ls -l /etc/freeradius/modules/file1

-rwxrwx--- 1 www-data freerad 0 Dec 15 10:28 /etc/freeradius/modules/file1

我的錯在哪里,該怎么辦?

我不確定您的代碼有什么問題,但是您可以嘗試以下操作:copy('/ etc / freeradius / modules / file1','/ etc / freeradius / modules / file2');

是的,錯誤是我無權從www-data用戶訪問freeradius文件夾,因此當我通過www-data設置freeradius所有者時,問題已解決

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM