开发者

PHP-CLI Permission Question

开发者 https://www.devze.com 2023-03-11 05:19 出处:网络
Dear Stackoverflow\'er: I am currently trying to run my script over PHP-CLI. I want to create a file over:

Dear Stackoverflow'er:

I am currently trying to run my script over PHP-CLI. I want to create a file over: fopen($filename, "w+")

If I run this over this over the webbrowser, the script will be able to create the file, since the folder is owned by 'www-data'.

But if I try to run it over CLI it doesn't work, since PHP has not the same user, so I added www-data into /etc/sudoers with NOPASSWD. I tried then to run: sudo -u www-data php ./content.php

But it still doesn't work, do you have maybe a suggestion?

Best, djcr开发者_C百科ackhome

0

精彩评论

暂无评论...
验证码 换一张
取 消