I have a Python script that is executed through PHP but the script runs under the user ubuntu. How do I change my Python script to run as the same user as my PHP script which is www-data?
If this is not a safe way to do this, what would be?
The Python script performs tasks on files that are uploaded via PHP and PHP automatically sets the owner and group to www-data. I execute the python script from the command line and it works but when executed through PHP the Python script doesnt have permission to execute its task on the uploaded files.