3

I can't upload images in Drupal 7 since I have moved it to a new server: php safe mode was on. So in php.ini I set safe_mode = Off (through ssh, I have CentOS).

phpinfo() shows that safe_mode is off for master, but on local. I do have a Plesk panel, so I checked there: safe_mode was enabled for the domain. I disabled it.

My problem: safe_mode is still turned on locally according to phpinfo(). What other ways do you know to turn off safe_mode? What can be wrong?

Thanks in advance.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
Ben Rogmans
  • 987
  • 1
  • 14
  • 22
  • 9
    Did you restart the webserver? If it's an apache you'll need to do so for it to reread the config file – edorian Jun 14 '11 at 14:52
  • You may aso be able to do an [`.htaccess`](http://php.net/manual/en/configuration.changes.php) and specify to disable safe mode. – Brad Christie Jun 14 '11 at 15:01
  • Make sure you're changing the right .ini file as well. PHP tends to have at least two of them (one for web-based, one for command-line), and some distros set up even more for various purposes. You can change it in one spot only to have it overridden elsewhere. – Marc B Jun 14 '11 at 15:04
  • @Marc B I checked which one I should edit @Brad Christie Turning off safe mode in .htaccess worked by the way, but I suppose this is not the most clean way to do it. – Ben Rogmans Jun 14 '11 at 15:08

2 Answers2

2

What you need to do first is to edit the main php.ini that overrides all php.ini in domains.

Go to

/etc/php.ini

and set safe_mode off.

Then restart your web server. You may now set safe_mode on to certain domains using their own php.ini.

Hope this helps.

0

Check your httpd.conf and vhost files for...

php_admin_flag safe_mode on

This flag overrides the setting in your php.ini file. Change it to...

php_admin_flag safe_mode off

...and restart apache.

EDIT: Also check the /etc/httpd/conf.d/zz_psa_httpd.conf for that directive.

Kirby Todd
  • 11,254
  • 3
  • 32
  • 60