Turning off PHP safe mode with Plesk
While working on an application that creates it’s own directories on the fly and then inserts images in them I came across some safe mode errors. Basically what they were is that I was creating a folder with the script which would then set the user to be ‘apache’ and then when the script went to write in it again and it didn’t actually own that folder, apache did.
I found some other more complicated solutions on the net where you have to edit the php.ini file and one where you edit the vhosts file. I figured there had to be a way to do it through Plesk and I finally found it so I figured I would share it so that no one else has to deal with it.
This is what the error looks like:
Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 10004 is not allowed to access /var/www/vhosts/xxx/xxx/xxxx owned by uid 48 in /var/www/vhosts/xxx/xxx/xxx/upload.php on line 98
So go into plesk and follow these steps…
- Click Domains over on the left
- Choose the domain you are wanting to disable safe mode on
- Under the hosting section choose setup
- Scroll down and under services find the one that says ‘PHP support’
- Leave that box checked but uncheck the one to the right of it that says ‘(PHP ’safe_mode’ on )’
- Click ok and you are done.
Hope this helps.
Tags: php


