我正在Linux mint中的localhost上使用Apache服务器,需要使用php脚本创建新文件和文件夹。 但它正在'mkdir'函数返回权限被拒绝。 p>
我用Google搜索并发现Apache需要以root身份运行才能获得此类权限。 它在我的机器中以'www-data'运行。 但我也发现以root身份运行Apache会打开很多漏洞,而且根本不需要Apache以root身份运行。 p>
如何克服apache中的权限限制? p> div>
I am working on Apache server on localhost in Linux mint and need to create new file and folder using php script. But it is returning permission denied on 'mkdir' function.
I googled and found that Apache needs to run as root for such permissions. It is running as 'www-data' in my machine. But I also found that running Apache as root will open many vulnerabilities and there is no situation where Apache is needed to run as root.
How to overcome permission restrictions in apache?
我正在Linux mint中的localhost上使用Apache服务器,需要使用php脚本创建新文件和文件夹。 但它正在'mkdir'函数返回权限被拒绝。 p>
我用Google搜索并发现Apache需要以root身份运行才能获得此类权限。 它在我的机器中以'www-data'运行。 但我也发现以root身份运行Apache会打开很多漏洞,而且根本不需要Apache以root身份运行。 p>
如何克服apache中的权限限制? p> div>