I created another profile for wine in /home/username/.wine/ But my php still uses the root username to access, so it uses wine profile for root. I think I narrowed down the problem. I have permission issues. Wine can run the program itself. but when program.exe wants to start its processing, it fails creating its own temp files or accessing some files it needs on the system. When running it directly in shell, it has full access to any file, that's why it works fine. But with php it doesn't. chowning wine profile doesn't seem to work. How can I move my .wine to another folder? I dont' wanna create another one. Just move this working one to my public_html folder, so that maybe it works there? or just find the option in apache (I use nginx) to give permission to this one.