php / php-src

The PHP Interpreter
https://www.php.net
Other
38.05k stars 7.73k forks source link

The api json result output params and result together #13281

Open zhangchunsheng opened 8 months ago

zhangchunsheng commented 8 months ago

Description

I don't understand the api json result output params and result together. I only returned the result. This can be resolved when I restart the php-fpm, but the problem still can happen again.

Resulted in this output:

{params, result}

But I expected this output instead:

{result}

image

PHP Version

8.1.27

Operating System

CentOS Stream release 9 5.14.0-361.el9.x86_64

devnexen commented 8 months ago

Would it be possible for you to share a reproducible case please ?

zhangchunsheng commented 8 months ago

Would it be possible for you to share a reproducible case please ?

This morning it happend again with https://gaip-api.wepromo.cn/admin/auth/login.

The below login failed, because the result contains params with result. This login page is provided by dcat-admin.

image

The phpinfo https://gist.github.com/zhangchunsheng/32ea67360255c19a11a1dd0c3f3707c7

The os is CentOS Stream release 9

The rpm info

php-common-8.1.27-1.el9.remi.x86_64
php-fpm-8.1.27-1.el9.remi.x86_64
php-cli-8.1.27-1.el9.remi.x86_64
php-opcache-8.1.27-1.el9.remi.x86_64
php-pdo-8.1.27-1.el9.remi.x86_64
oniguruma5php-6.9.9-1.el9.remi.x86_64
php-mbstring-8.1.27-1.el9.remi.x86_64
php-sodium-8.1.27-1.el9.remi.x86_64
php-xml-8.1.27-1.el9.remi.x86_64
php-8.1.27-1.el9.remi.x86_64
php-mysqlnd-8.1.27-1.el9.remi.x86_64
php-pecl-mysql-1.0.0-0.25.20210423.ca514c4.el9.remi.8.1.x86_64
php-pecl-msgpack-2.2.0-1.el9.remi.8.1.x86_64
php-pecl-igbinary-3.2.15-1.el9.remi.8.1.x86_64
php-pecl-redis6-6.0.2-1.el9.remi.8.1.x86_64
php-pecl-imagick-im6-3.7.0-7.el9.remi.8.1.x86_64
gd3php-2.3.3-9.el9.remi.x86_64
php-gd-8.1.27-1.el9.remi.x86_64
php-bcmath-8.1.27-1.el9.remi.x86_64
php-intl-8.1.27-1.el9.remi.x86_64
php-pecl-zip-1.22.3-1.el9.remi.8.1.x86_64
php-process-8.1.27-1.el9.remi.x86_64

The comoser.json

"require": {
        "php": "^8.1",
        "aliyuncs/oss-sdk-php": "^2.6",
        "darkaonline/l5-swagger": "^8.5",
        "dcat/easy-excel": "^1.1",
        "doctrine/annotations": "^2.0",
        "doctrine/cache": "^2.2",
        "gregwar/captcha-bundle": "^2.2",
        "guzzlehttp/guzzle": "^7.2",
        "hg/apidoc": "^5.2",
        "jianyan74/php-excel": "^1.0",
        "laravel/framework": "^10.10",
        "laravel/horizon": "^5.21",
        "laravel/sanctum": "^3.3",
        "laravel/tinker": "^2.8",
        "league/flysystem-aws-s3-v3": "^3.21",
        "luomor/dcat-admin": "2.*",
        "overtrue/laravel-filesystem-cos": "^3.4",
        "phpoffice/phpspreadsheet": "^1.29",
        "qcloud/cos-sdk-v5": "^2.6",
        "qiniu/php-sdk": "^7.11",
        "rtheunissen/guzzle-log-middleware": "^2.0",
        "simplesoftwareio/simple-qrcode": "^4.2",
        "symfony/cache": "^6.4",
        "tencentcloud/tencentcloud-sdk-php": "^3.0",
        "tymon/jwt-auth": "2.0.0",
        "w7corp/easywechat": "^6.12.11"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.1",
        "spatie/laravel-ignition": "^2.0"
    },
zhangchunsheng commented 8 months ago

Would it be possible for you to share a reproducible case please ?

Maybe you can try it on CentOS Stream release 9 with dcat-admin (https://github.com/jqhph/dcat-admin). I install the php with yum.

zhangchunsheng commented 8 months ago

This morning it happend again. I downgrade to 8.1.26.

bukka commented 8 months ago

You really need to provide more more info how this can be re-created or we can at least get idea what's going on. Can you send some info how the application is installed and run. It would be good if you provide fpm config and your php.ini (result of php -i). It would be also good if you could check logs and see if there is anything unusual there (potentially enable fpm debug level and see output of that).

bukka commented 8 months ago

Sorry missed php -i output which you linked above. Please provide the rest and mainly describe how often this is happening and see if there is anything unusual in logs. Also are you able to reliably re-create it in different environments? If so please describe the steps in detail.