search
HomeBackend DevelopmentPHP ProblemWhat to do if thinkphp5 ajax reports 500 error

php Ajax500 error solution: first open the error script file; then modify the error code to "echo json_encode($arr)"; finally save the modified file.

What to do if thinkphp5 ajax reports 500 error

Recommendation: "PHP Tutorial"

Scenario: Several sites from Alibaba Cloud Migrate to Tencent Cloud, and then TP5 project ajax request reports 500 error. The data is returned successfully, but the http status code is 500. If you don’t go to success, you keep going to error

## as shown below:

## Reason analysis:

The server centos version is different, but according to experience, it should not be caused by it. The tracking code is not caused by different versions,

Just throw the method:

## As shown above: Do not use exit() method, do not use json(), Use echo json_encode($arr)

That’s it

The above is the detailed content of What to do if thinkphp5 ajax reports 500 error. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.