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.
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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
Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver Mac version
Visual web development tools

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.
