Database creation via Legacy API from plugin

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
2,462
Location
UA
Hello,

I'm trying to create database via plugin (like CMS install) but it shows 500 error on POST requests to CMD_API_DATABASES
in browser inspection tab I can see only (details=Unable+to+execute+script&error=1&text=An+Error+has+occurred)
This plugin works fine on other server. This one little outdated with Centos7 (DA legacy).
Please help to solve.
Screen attached.
 

Attachments

  • 2025-05-28_14-23.png
    2025-05-28_14-23.png
    33.7 KB · Views: 6
Checked the domain logs and error logs and also the php logs from the user?

Maybe you can also use something like this in the .htaccess file to trace the error more direct?
Code:
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_value error_log /home/username/domains/domain.com/public_html/PHPERROR.log
this might be too many lines but some of these work and throw visible errors when things go wrong.
 
this might be too many lines but some of these work and throw visible errors when things go wrong.

It is not related. The error occurs on DirectAdmin's side and has nothing to do with PHP settings at all.

checked, no errors or any mentions logged

You might check system journals as well for possible existing errors:

Bash:
journalctl -u directadmin

for possible live errors:

Bash:
journalctl -u directadmin -f

And you don't find even POST request to /CMD_API_DATABASES?

What if you connect to Directadmin as an user in a browser and go to the page /CMD_API_DATABASES?json=yes will it give 500 error too?

And do you use user's credentials for POST requests to /CMD_API_DATABASES or a session hash?

If nothing helps, then you might run Directadmin in a debug mode and see what it might complain about when it gets a POST request.
 
Back
Top