PHP 스크립트 (restore.php) :PHP의 CP 권한 문제
string(6) "apache"
string(115) "cp: cannot create regular file `/var/www/html/227.png': Permission denied cp: cannot remove `/var/www/html/234.png' Permission denied "
콘솔 :
cd /var/www/html
sudo -u apache touch test.txt
ls test.txt
-> test.txt
sudo -u rm 234.png -f
ls 234.png
-> ls: 234.png: No such file or directory
sudo -u apache php restore.php
ls 234.png
-> 234.png
스크립트가 브라우저에서 액세스 할
var_dump(get_current_user());
var_dump(shell_exec(" cp /var/www/bkp/* /var/www/html 2>&1 "));
누구나 브라우저에서 실행할 때 왜 내 PHP 스크립트에서 권한 문제가 발생하는지 설명 할 수 있습니까?
이 질문의 주제는 무엇입니까? – HyderA