• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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