Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Error while modifying domain settings in Plesk "Cannot build Apache web server  (Read 3413 times)

0 Members and 1 Guest are viewing this topic.

Rahul Krishnan N

  • Guest
Error while modifying domain settings  in Plesk "Cannot build Apache web server configuration: "Invalid parameter number: no parameters were bound"

In Plesk Admin panel home page, it will show the error message "Error: New files of configuration for Apache web server were not built due to errors in configuration templates. The detailed error message was e-mailed to you, so please check the e-mail, fix the errors, and click here to retry generating configuration."

This error is due to the database parameter mismatches and below mentioned is the way to fix it.


1) It is advisable to take a  PSA database dump before making the modifications,

mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` psa > psa.sql

2) Login to MySQL as admin user

mysql -uadmin -p`cat /etc/psa/.psa/shadow` psa

3) Find the configuration errors from PSA DB

mysql> select id,objectId,status,description from Configurations where status="error";

You will see the error description as  "Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound"

3) List broken contexts of the APS applications

mysql> select aps.id, pleskId, subscriptionId, s.id as MainSubscriptionId, su.id as AddSubscriptionId from apsContexts aps left join domains d on d.id=aps.pleskId left join domains w on w.id = d.webspace_id left join Subscriptions s on s.object_id=d.id left join Subscriptions su on su.object_id = w.id where (subscriptionId!=s.id and su.id is null) or (subscriptionId!=su.id and s.id is null) or aps.subscriptionId is null;

In the list, you will see mismaches between subscriptionId and  MainSubscriptionId or AdditionalSubscriptionId. You have to make the correction such that the subscriptionId should be equal to
MainSubscriptionId or AdditionalSubscriptionId (Select the integer value and neglect the Null Value).

For example let the out put of the above query be :-

+----+---------+----------------+--------------------+-------------------+
| id | pleskId | subscriptionId | MainSubscriptionId | AddSubscriptionId |
+----+---------+----------------+--------------------+-------------------+
|  2 |       1 |                          0 |                          1 |                NULL |

And you have to correct the subscription ID to be one (as in the MainSubscriptionId)

mysql> update apsContexts set subscriptionId=1 where pleskId=1;


5) Reconfigure Apache configurations

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all