§Dealing with safe_mode.
"Nassssty safe_mode.. We hatesss it, but we have to deal, my preciousss.. ", Gollum - undated quote..
PHP has a feature called safe_mode. This 'feature' tries to deal with imminent security breaches by crippling or simply disabling parts of PHP. Any server that runs in safe_mode will have some or more problems running Pivot. It might work, it might not.. No way of knowing if it works on your server until you try it. If you do not know if your server is in safe_mode, you can look it up in the output of your phpinfo. For more info: see Phpinfo is your friend.
Here's what the php manual has to say about safe_mode:
The PHP safe mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now. - www.php.net/features.safe-mode
Personally I detest safe_mode. Because hosting providers cripple some features of PHP, they force me, as a developer, to pull all kinds of tricks to make Pivot work, making it potentionally less safe to use.
But, enough with the ranting.. If your server is running in safe_mode, here are some tips to make Pivot live in peace with your server:
- First of all: Email your hosting provider.. Ask them if they can turn off safe_mode for your virtual host or subdomain.. Or, let me rephrase that: Ask them if they want to turn it off, because they surely can, but often do not want to do so.
- Download the weblog's frontpage (most commonly index.php) from your server to your local computer. Remove it from the webserver, and then upload it again, and chmod it to 755 or 777. By doing this you have changed the 'owner' of the file, and Pivot might work better..
- Remove the [[calendar]], [[getref]], [[printref]] tags from your frontpage, and see if it works better.. If so, place them back one at a time. Regenerate your frontpage and see if it works. If it starts complaining about certain files, try chmodding these files to 755 or 777.
- some instances of safe_more do not allow the creation of folders on your webserver.. or, even more silly: Pivot is not allowed to save files in folders that it was allowed to create moments before. This will give problems when you've written 100 entries.. To help this, you should make some folders in the pivot/db/ folder yourself: db/standard-00100/, db/standard-00200/ etc., and chmod them to 777. This way Pivot will most likely be able to write the entries to these folders.
With these tips, most servers can run pivot to some degree.. My personal site runs on a server in safe_mode, and after some tweaks I've been able to get it to run flawlessly.. However, if you have the choice between a host with or without safe_mode turned on, always go with the host without it. Good luck Tweaking!
Dealing with Open_basedir
If you get messages like this:
Warning: open_basedir restriction in effect. File is in wrong directory in /docroot/script.php on line 2
There is no way pivot will ever work on your server. I'd suggest you cancel your subscription with your hosting provider, because they crippled PHP to a point that's it's become totally unusable.