I have the following problem.
Using laravel and cronjob, I run a routine that checks for each client whether to delete it and also deletes its database.
To delete the database, I am using the HTTP API - calling the server itself via php CURL.
However, there is a bug, the database is deleted, but the db.conf file is not updated (deleting the database line deleted in this step). That is, it deletes but does not update in db.conf
So I have backup problems…
I’ve already reviewed the code and can’t find the problem.
I’ll try to use it via CLI CLI Reference | Hestia Control Panel
Is there any way to call this command via PHP?
Yes, you can use Hestia’s API to run
Take a look to doc to enable API:
Here some php examples:
If you prefer to use a shell script, take a look to this wrapper:
I think you did not understand. I already use the hestia API but it is generating errors in the db.conf files when deleting the database.
For this reason, I want to use via shell command (example: v-delete-database)
How can I run the “v-delete-database” command directly in php/shell?
You are already using it. Hestia Web UI and Hestia API execute
v-delete-database script to delete the db so you won’t see any difference.