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?