In a script, I use
I ran directadmin in debug mode, and these are the results. The only real difference I can see is the
A server where everything works as normal:
And a server where the result is empty (but PHP version is changed):
CMD_API_DOMAIN
to change the selected PHP version for a domain. On most servers, this works fine. However, one some servers, the PHP selection is done, but the result handed back from the API is empty, leaving my script to be somewhat confused as to what happened with the API call.I ran directadmin in debug mode, and these are the results. The only real difference I can see is the
api=0
vs api=1
. I don't know what that actually means, but it seems maybe directadmin thinks it wasn't an API call, and that's why it doesn't return anything? Does anyone know what could cause this, and how to fix it?A server where everything works as normal:
Code:
# ./directadmin version
DirectAdmin v.1.643 3d897a3a089fd226d878f21666efcd2a35fcc3e8
# ./directadmin server "--debug=2000"
[...]
/CMD_API_DOMAIN
0: Accept-Encoding: gzip
1: Accept: */*
2: Authorization: Basic <redacted>
3: Content-Length: 71
4: Content-Type: application/x-www-form-urlencoded
5: Da-Ipc-Signature: <redacted>
6: Da-Licc-Nresellers: -1
7: Da-Licc-Nusers: -1
8: Da-Licc-Vdomains: -1
9: Host: <redacted>:2222
10: Https: //<redacted>:2222
11: User-Agent: HTTPSocket/3.0.1
12: X-Da-Remote-Ip: <redacted>
13: X-Forwarded-For: <redacted>
Post string: action=php_selector&domain=<redacted>&php1_select=3&php2_select=0
Authentication::creatorValid: got type 3 for user admin: isDemo=0
auth.authenticated
Plugin::addHooks: start
Plugin::addHooks: end
Command::doCommand(/CMD_API_DOMAIN)
Apache::write_php_fpm_cgi: No domains for User <redacted> are using php 81. Deleting /usr/local/directadmin/data/users/<redacted>/php/php-fpm81.conf to reduce the number of unused pools.
Apache::write_php_fpm_cgi: No domains for User <redacted> are using php 80. Deleting /usr/local/directadmin/data/users/<redacted>/php/php-fpm80.conf to reduce the number of unused pools.
installing crontab (use_template=0 euid=0): /usr/bin/crontab -u <redacted> ./data/users/<redacted>/crontab.conf.tmp 2>&1
#direct_crons enabled. Safe to edit this file. DirectAdmin will update accordingly.
PATH=/usr/local/php74/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/<redacted>/.local/bin:/home/<redacted>/bin
Dynamic(api=1, error=0):
text='PHP versions saved'
result='<a href="CMD_ADDITIONAL_DOMAINS?action=view&domain=<redacted>">Back</a>'
Command::doCommand(/CMD_API_DOMAIN) : finished
Command::run: finished /CMD_API_DOMAIN
[...]
## My script receives this array as a result:
Array
(
[error] => 0
[text] => PHP versions saved
[details] => <a href="CMD_ADDITIONAL_DOMAINS?action=view&domain=<redacted>">Back</a>
)
And a server where the result is empty (but PHP version is changed):
Code:
# ./directadmin version
DirectAdmin v.1.643 3d897a3a089fd226d878f21666efcd2a35fcc3e8
# ./directadmin server "--debug=2000"
[...]
/CMD_API_DOMAIN
0: Accept-Encoding: gzip
1: Accept: */*
2: Authorization: Basic <redacted>
3: Content-Length: 69
4: Content-Type: application/x-www-form-urlencoded
5: Da-Ipc-Signature: <redacted>
6: Da-Licc-Nresellers: -1
7: Da-Licc-Nusers: -1
8: Da-Licc-Vdomains: -1
9: Host: <redacted>:2222
10: Https: //<redacted>:2222
11: User-Agent: HTTPSocket/3.0.1
12: X-Da-Remote-Ip: <redacted>
13: X-Forwarded-For: <redacted>
Post string: action=php_selector&domain=<redacted>&php1_select=3&php2_select=0
Authentication::creatorValid: got type 3 for user admin: isDemo=0
auth.authenticated
Plugin::addHooks: start
Plugin::addHooks: end
Command::doCommand(/CMD_API_DOMAIN)
Apache::write_php_fpm_cgi: No domains for User <redacted> are using php 81. Deleting /usr/local/directadmin/data/users/<redacted>/php/php-fpm81.conf to reduce the number of unused pools.
Apache::write_php_fpm_cgi: No domains for User <redacted> are using php 80. Deleting /usr/local/directadmin/data/users/<redacted>/php/php-fpm80.conf to reduce the number of unused pools.
installing crontab (use_template=0 euid=0): /usr/bin/crontab -u <redacted> ./data/users/<redacted>/crontab.conf.tmp 2>&1
#direct_crons enabled. Safe to edit this file. DirectAdmin will update accordingly.
MAILTO=""
PATH=/usr/local/php74/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Dynamic(api=0, error=0):
text='PHP versions saved'
result='<a href="CMD_ADDITIONAL_DOMAINS?action=view&domain=<redacted>">Back</a>'
Command::doCommand(/CMD_API_DOMAIN) : finished
Command::run: finished /CMD_API_DOMAIN
[...]
## My script receives this array as a result:
Array
(
)