I’m in a little trouble with permissions on my Virtual Private Server with Dreamhost.
I need PHP recompiled so I recompile it and .php files are handled via .htaccess.
AddHandler phpfiles .php
Action phpfiles /cgi-bin/php-custom.cgi
This is fine. The problem is that if I run files with custom PHP pratically it’s impossible to do any file operation with PHP. Looks like that PHP (or apache) is running from a specific user (i guess ‘dhapache’) when directory are owned by ‘myusername’ user. For example if i try:
echo 'Cannot create the directory';
A ‘Cannt create the directory’ is shown. And this is not fine.
I cannot use ‘exec(‘mkdir /dirpath’);’ or ‘system’ calls because the whole project should be compatible with a lot of OS, such Windows. And, honestly, I think that there’s a lot of unsecure code using system calls.
If I switch off custom-php everything works but with the limitations that I cannon have for my project such max_filesize_upload, max_script_execution and so on.
Can someone help me?