install.php 200 body 为空 (已解决)
2020-11-23 00:36:26
Wei Liu
  • 访问次数: 11
  • 注册日期: 2017-04-12
  • 最后登录: 2020-11-23
  • 我的积分: 80
  • 门派等级: 无门派

首次安装,环境:centos8.2 + nginx 1.14.1 + php-fpm 7.2.24, ioncube 按提示安装成功。


网站域名:http://www.gupiaogs.store


php 信息: http://www.gupiaogs.store/test.php


php-fpm 日志:  www.gupiaogs.store.log

```

[23/Nov/2020:00:18:43 +0800] "GET /install.php HTTP/1.1" 200 22 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
- - [23/Nov/2020:00:19:19 +0800] "GET /install.php HTTP/1.1" 200 22 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
 - - [23/Nov/2020:00:19:42 +0800] "GET /install.php HTTP/1.1" 200 24 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
 - - [23/Nov/2020:00:19:54 +0800] "GET /install.php HTTP/1.1" 200 30 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
223.88.94.48 - - [23/Nov/2020:00:20:10 +0800] "GET /install.php HTTP/1.1" 200 35 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
 - - [23/Nov/2020:00:20:39 +0800] "GET /install.php HTTP/1.1" 200 40 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

```


www.gupiaogs.store.err.log

```


2020/11/22 21:54:22 [error] 28838#0: *341 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: {ip}, server: www.gupiaogs.store, request: "GET / HTTP/1.1", upstream: "http://unix:/run/php-fpm/www.sock:/", host: "www.gupiaogs.store"
2020/11/22 21:54:22 [error] 28838#0: *341 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: {ip}, server: www.gupiaogs.store, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/run/php-fpm/www.sock:/favicon.ico", host: "www.gupiaogs.store", referrer: "http://www.gupiaogs.store/"

```


从时间上来看,err.log 输出的错误已经不再出现。


另外,更改 install.php ,增加打印标记如下:

```

<?php
/**
 * The install router file of chanzhiEPS.
 *
 * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPLV12 (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     chanzhiEPS
 * @version     $Id$
 * @link        http://www.zsite.com
 */
echo "1.01\r\n<br/>";
/* Turn off error reporting first. */
error_reporting(0);

echo '1.02<br/>';
/* Start session. */
session_start();

/* Define the run mode as install. */
define('RUN_MODE', 'install');

/* Load the framework. */
i n c l u d e 'loader.php';

echo '1.03<br/>';
/* Instance the app and run it. */
$app = router::createApp('chanzhi', $s y s t e mRoot);

echo '1.04';
$config = $app->config;

echo '1.031';
/* Check installed or not. */
if(!isset($_SESSION['installing']) and !empty($config->installed)) die(header('location: index.php'));

echo '1.04';
/* Reset the config params. */
$config->set('requestType', 'GET');
$config->set('debug', true);
$config->set('default.module', 'install');
$app->setDebug();

echo '1.04';
/* Run the app. */
$app->parseRequest();
$app->loadModule();

echo '123';

```


输出内容如下:

```

1.01
1.02
1.03

```


看起来好像是这一行出错:

` $app = router::createApp('chanzhi', $s y s t e mRoot);`


s y s t e m/tmp/log 文件夹下只有一个空文件 index.html 


更改  ` error_reporting(0);` 参数0 为 1: ` error_reporting(1);`


install.php 输出:

```

Fatal error : Uncaught Error: Call to undefined function json_encode() in /www/chanzhieps/s y s t e m/config/chanzhieps.php:61 Stack trace: #0 /www/chanzhieps/s y s t e m/config/config.php(122): i n c l u d e() #1 /www/chanzhieps/s y s t e m/framework/base/router.class.php(1902): i n c l u d e('/www/chanzhieps...') #2 /www/chanzhieps/s y s t e m/framework/base/router.class.php(354): baseRouter->loadMainConfig() #3 /www/chanzhieps/s y s t e m/framework/router.class.php(38): baseRouter->__construct('chanzhi', '/www/chanzhieps...') #4 /www/chanzhieps/s y s t e m/framework/router.class.php(56): router->__construct('chanzhi', '/www/chanzhieps...') #5 /www/chanzhieps/www/install.php(28): router::createApp('chanzhi', '/www/chanzhieps...') #6 {main} thrown in  /www/chanzhieps/s y s t e m/config/chanzhieps.php  on line  61

``` 


可见是 json_encode 函数不识别,应该是 json 扩展没有安装。


解决: yum install -y php-json 


问题解决。

Wei Liu 最后编辑, 2020-11-23 01:51:05
沙发
2020-11-25 11:42:08
金凯
  • 访问次数: 187
  • 注册日期: 2020-09-27
  • 最后登录: 2021-04-14
  • 我的积分: 471
  • 门派等级: 无门派
1/1
联系我们

联系人:宋晓

电话/微信:15610450169

Email:songxiao@easycorp.ltd

QQ:2468103332

地址:青岛开发区长江路232号国贸中心C座2单元2902室