I wrote a script which "walks" through /var/www/xyz and scans folders and more. The folders are all 'user-bound', so the permissions for a single folder there are set to the specific user.
Running this script as root (for example in /root, 'php myscript.php') returns the expected results.
Now I want to transfer the results to the browser: in /var/www/newfolder I created a file index.php, just pasted the script into the file and tried it (in the browser) and of course failed. It just shows me a little part of the results (showing the user-specific folder names, when does not get deeper). Pretty sure it's a permission thing, being the www-user.
Phew, so the question is: is there a possibility to put a file with a function (for example) into /var, and allow a www user in the browser to ONLY CALL THAT function? If yes, any useful links or tips? (I googled really hard and a long time now, but what I found was worth nothing)
OR
Call a function in my /var/www/newfolder/ which has enough permission to scan the user-folders? (I guess that is critical regarding safety)