• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Possible API bugs?

Matthew James

Basic Pleskian
Hi,

It seems that whatever you try and set the php_handler_type to for a domain template created through the API, it ignores the setting and sets it to "module".

The request I sent included the following which returned "ok" and the template was created:

<property>
<name>php_handler_type</name>
<value>cgi</value>
</property>

Yet when looking in Plesk or retrieving the details of the template, it shows it set as Apache Module:

<property>
<name>php_handler_type</name>
<value>module</value>
</property>

Also, it seems to ignore the "same_ssl" parameter for setting "Use a single directory for housing SSL and non-SSL content". In fact, it doesn't even report "same_ssl" back as one of the parameters when retrieving info about the template, you can see it's not checked in Plesk for the template though.

Has anybody come across these bugs? If so, do you know of any workarounds?

Thanks
 
Well it doesn't matter if you set it as fastcgi or cgi, it still gets completely ignored and just gets set as apache module. According to the "retrieving descriptors of hosting settings", this should be possible:

<property>
<name>php_handler_type</name>
<type>string</type>

<enum>
<value>module</value>
<label>__php_module_handler</label>
</enum>

<enum>
<value>cgi</value>
<label>__php_cgi_handler</label>
</enum>

<enum>
<value>fastcgi</value>
<label>__php_fastcgi_handler</label>
</enum>

<writable-by>admin</writable-by>
<label>__php_run_as</label>
<extension>
<levels>domain</levels>
<levels>subdomain</levels>
</extension>
</property>

Also, do you know why the "same_ssl" parameter is also being ignored, this is also listed when retrieving descriptors of hosting settings:

<property>
<name>same_ssl</name>
<type>boolean</type>
<writable-by>admin</writable-by>
<label>__same_ssl</label>
<extension>
<levels>domain</levels>
<levels>subdomain</levels>
</extension>
</property>

Thanks
 
Last edited:
I have forwarded your questions to developers. I will update this thread with their reply as soon as I receive it.
 
1. The 'php_handler' option is ignored when 'php' option is set to false or not specified in API-RPC request.
Try to set the 'php' option to enabled and set required php handler type. This can be done during the creation of domain template:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.0.0">
<domain-template>
<add>
<name>domain template</name>
<hosting>
<property>
<name>php</name>
<value>true</value>
</property>
<property>
<name>php_handler_type</name>
<value>cgi</value>
</property>
</hosting>
</add>
</domain-template>
</packet>

2. We have already submitted bug about ignoring of the 'same_ssl' option. It is under developer's investigation now.
 
My original request already contained this (and it set php to on without any problems) yet it ignores the php handler type. If you were able to get it to work, please can you send me the exact full request that you sent?
 
Is there a further update on this?

In the meantime, I have attempted to add an Event Handler on domain creation that sets same_ssl to true and php_handler_type to cgi yet this doesn't work.

If I run the same command that I am adding the the Event Handler via SSH, it works fine and updates them as expected:

/usr/local/psa/bin/domain.sh --update testingtestingtesting.com -php_handler_type cgi -same_ssl true
SUCCESS: Update of domain 'testingtestingtesting.com' complete.

Is there a reason why this wouldn't work with the Event Handler, can I see Event Handler error logs anywhere?

Thanks
 
Is there an update on this?

It's really bad that these simple bugs are not resolved even after a few months of them being reported, this is causing problems for me as I cannot use your API properly.

I don't want to have to move to a different control panel but feel I might have to if some of these bugs aren't resolved once they have been reported.
 
Back
Top