Php Safe_Mode And Captcha

Hi all,

I have been going around in circles for a few days now, trying to find out why the captcha image does not display on the live web site.

Eventually it has led me to the php.ini files ‘safe_mode’. From the ‘application.log’:


2013/03/18 11:56:15 [error] [exception.ImagickDrawException] exception 'ImagickDrawException' with message 'Safe mode restricts user to read file: /var/www/vhosts/website.com/private/YiiRoot/framework/web/widgets/captcha/Duality.ttf' in /var/www/vhosts/website.com/private/YiiRoot/framework/web/widgets/captcha/CCaptchaAction.php:307

I am assuming that in order for ‘captcha’ to work it needs to write to a file, or create a file? Currently, users are restricted to just read a file.

The host server has a ‘/private/’ folder which users can not access online. However the permissions are ‘rwxr-xr-x’: this is the same for all sub-folders as well.

Would turning off ‘safe_mode’ be safe?

Would this be a better option:


safe_mode_include_dir = /var/www/vhosts/website.com/private/YiiRoot/framework/web/widgets/captcha/

I seem to be the only one having this problem lately and I am at a loss why this is so.


Update: The reason for my troubles is that the host company have set “safe_mode” to “on”. Now that I have requested that this be turned off the ‘captcha’ image is now visible. Problem solved.