Unable use Event Handler: PHP Fatal error: Call to a member function getParam() on null

Created:

2016-11-16 13:06:43 UTC

Modified:

2017-08-08 13:35:47 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable use Event Handler: PHP Fatal error: Call to a member function getParam() on null

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

An extention is created to handle domain creation event. It fails with an error:

PHP Fatal error: Call to a member function getParam() on null in /usr/local/psa/admin/plib/api-rpc/AbscractAgentMail.php on line 730

Cause

Domain Created event is launched before mail service is created for the domain.It is Plesk internal issue #PPPM-4785 , which is planned to be fixed in the one of the next product updates.

Workaround

There are two options:

  1. Use event 'Physical Hosting Created' - it is launched after both mail and web services are created. Note: Physical Hosting Created event is not applicable for domains without web hosting.

  2. Use delay between the queries:add some timeout before the second request, e.g., sleep 5 before request2= line in the script.

Have more questions? Submit a request
Please sign in to leave a comment.