简体   繁体   English

无法关闭 PHP 安全模式?

[英]Impossible to turn off PHP safe_mode?

I can't upload images in Drupal 7 since I have moved it to a new server: php safe mode was on.我无法在 Drupal 7 中上传图像,因为我已将其移至新服务器:php 安全模式已打开。 So in php.ini I set safe_mode = Off (through ssh, I have CentOS).所以在 php.ini 中我设置了safe_mode = Off (通过 ssh,我有 CentOS)。

phpinfo() shows that safe_mode is off for master, but on local. phpinfo()显示 master 的 safe_mode 已关闭,但在本地。 I do have a Plesk panel, so I checked there: safe_mode was enabled for the domain.我确实有一个 Plesk 面板,所以我在那里检查:为safe_mode启用了安全模式。 I disabled it.我禁用了它。

My problem: safe_mode is still turned on locally according to phpinfo() .我的问题: safe_mode根据phpinfo()仍然在本地打开。 What other ways do you know to turn off safe_mode ?您还知道哪些其他方法可以关闭safe_mode What can be wrong?有什么问题?

Thanks in advance.提前致谢。

What you need to do first is to edit the main php.ini that overrides all php.ini in domains.您首先需要做的是编辑覆盖域中所有 php.ini 的主要 php.ini。

Go to Go 至

/etc/php.ini

and set safe_mode off.并关闭安全模式。

Then restart your web server.然后重新启动您的 web 服务器。 You may now set safe_mode on to certain domains using their own php.ini.您现在可以使用自己的 php.ini 为某些域设置安全模式。

Hope this helps.希望这可以帮助。

Check your httpd.conf and vhost files for...检查您的 httpd.conf 和 vhost 文件是否...

php_admin_flag safe_mode on

This flag overrides the setting in your php.ini file.此标志会覆盖 php.ini 文件中的设置。 Change it to...将其更改为...

php_admin_flag safe_mode off

...and restart apache. ...并重新启动 apache。

EDIT: Also check the /etc/httpd/conf.d/zz_psa_httpd.conf for that directive.编辑:还要检查该指令的 /etc/httpd/conf.d/zz_psa_httpd.conf 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM