0

I am trying to use the backquotes to execute a system command, but it says the following message:

  CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set

So.. I guess I need to turn off safe mode. I have no idea how to do this.

Can anyone walk me through? phpinfo() says that my "safe_mode" directive is off for Master Value, but is on for Local Value.

I guess there's a switch somewhere I need to set?

Thanks!

caesar
  • 3
  • 3

2 Answers2

1

'Master Value' is basically the value inside php.ini. The 'local value' is the directory you're looking at.

A simple way is to turn off the safe mode only for that specific directory like the following

Add this to the end of httpd.conf and make sure you restart your apache server.

<Directory /var/www/html>
php_admin_flag safe_mode off
</Directory>
Sobiaholic
  • 2,927
  • 9
  • 37
  • 54
1

This issue mostly caused by enabled open_basedir php setting, not safe_mode(safe mode setting removed since php5.4 http://php.net/manual/en/features.safe-mode.php, but this issue still appears after that). To rid off this message do one of the following.

  1. If you have access to php.ini file, search open_basedir option and uncomment it(like that ;open_basedir=/home/sites/site81/:/tmp/:/) or add this php_admin_value open_basedir "/home/sites/site81/:/tmp/:/" to http.conf apache config file

  2. If you use shared hosting, contact to server admins to fix only for host. If you use plesk read 3rd answer How can I relax PHP's open_basedir restriction?

Community
  • 1
  • 1