To turn off safe mode globally, follow the below steps.
1. Login to your server via SSH.
2. Open php.ini file, you can find it in this path "vi/etc/php.ini.
3. Find the code "safe_mode = On.
4. Edit that code to "safe_mode = Off.
5. Now restart Apache using the code "/etc/init.d/httpd restart.