在安装 MediaWiki 时显示警告:
Warning: putenv() has been disabled for security reasons in /storage/ssd1/808/4772808/public_html/includes/Setup.php on line 129
但是不影响 MediaWiki 的安装。
安装完成后,本来应该正常显示的网站主页只出现了如下报错代码:
Warning: putenv() has been disabled for security reasons in /storage/ssd1/808/4772808/public_html/includes/Setup.php on line 129
Warning: putenv() has been disabled for security reasons in /storage/ssd1/808/4772808/public_html/includes/Setup.php on line 129
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/libs/HttpStatus.php on line 112
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/WebResponse.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/WebResponse.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/WebResponse.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/WebResponse.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/WebResponse.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/808/4772808/public_html/LocalSettings.php:1) in /storage/ssd1/808/4772808/public_html/includes/WebResponse.php on line 46
楼主并非程序员,更没有 PHP 经验,只能摸索着试图解决。在网上看到有人说可以修改 PHP.ini 中“输出缓冲区数据块设置”解决,但在网站的空间内没有找到这个文件。托管商提供了 phpMyAdmin 工具,但是也并没有找到可以解决这个问题的地方,万般无奈之下只好来这里求助了,希望有人能指点迷津,不胜感激之至!
1
muzhidianzi 2018-10-05 04:04:02 +08:00 via Android
也是新手 野路子出身 萌新抛砖引玉下 貌似是 PHP 安全模式? 部分函数被禁用了,需要去 php 的配置文件 php.ini 里禁用安全模式 看楼主描述貌似购买的是空间而不是 vps 或者服务器?这样应该是接触不到配置文件无法修改的。
此外 phpmyadmin 是一个基于 php 的 web 端数据库管理程序 只是基于 php 而已 有说错地方各位大佬斧正 |
2
ysc3839 2018-10-05 04:04:04 +08:00 via Android
关闭错误输出试试。一般情况下非开发环境不应该开启错误输出,以免泄漏敏感信息。
|
3
muzhidianzi 2018-10-05 04:08:26 +08:00 via Android
话说去 Google 的这个函数,居然搜到这个帖子,蜘蛛爬的真勤快
|
4
580a388da131 2018-10-05 09:22:00 +08:00 via iPhone
Warning: putenv() has been disabled
它不是说了函数 putenv() 被禁用了么 |
5
Taxila OP @muzhidianzi 确实是空间而非服务器。查了一下确实没法改 php.ini ,但是可以改 .htaccess …
|
7
muzhidianzi 2018-10-05 10:39:16 +08:00 via Android
|
8
Taxila OP 目前通过 https://www.mddhosting.com/support/knowledgebase/115/PHP---Cannot-modify-header-information---headers-already-sent-by-.html 给出的解决代码已经消除了 Warning: Cannot modify header information 警告,并且能够正常打开页面了。
但是页面上方依然有一行 Warning: putenv() has been disabled for security reasons in /storage/ssd1/808/4772808/public_html/includes/Setup.php on line 129 即使用到了 @muzhidianzi 给的代码也没法消除,还是令人不爽。 |
10
RiESA 2018-10-05 11:32:57 +08:00
; display_errors
; Default Value: On ; Development Value: On ; Production Value: Off ; display_startup_errors ; Default Value: Off ; Development Value: On ; Production Value: Off ; error_reporting ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; html_errors ; Default Value: On ; Development Value: On ; Production value: On ; log_errors ; Default Value: Off ; Development Value: On ; Production Value: On |
11
RiESA 2018-10-05 11:34:03 +08:00
我之前安装的时候也遇到过,不过我是通过修改 php.ini 处理的,上面是我目前的设置,你可以参考一下
|