WHMCS and WordPress Multisite on separate servers

I would like to have WordPress multisite hosted on a dedicated server and have WHMCS on a different dedicated server. It doesn't make sense to have your support line, i.e. WHMCS on the same server that goes down when something else hits the fan.

That said I have setup the two sites on separate boxes and come to a halt when running the module. I get an error that reads;

Order Accept Encountered Problems
Connection Error: 6 - Couldn't resolve host 'clientarea.php'

Not sure what file it's referring to... had anyone done this before? Am I missing something?

  • Alexander

    Hi there @epkhosting,

    This is possible as the connection is made over the URL. So even when working on the same machine, it connects as if the WHMCS installation was remote. Would you mind clarifying a few things for me just so I can have as much information as possible?

    Are you getting this error on the WHMCS side, or the Wordpress side? What are the steps taken leading up to the error?

    In the meantime, I'm getting a test environment setup so I can try to reproduce this.

    Best regards

  • WP Chef

    To reproduce the error;

    1) Login to WHMCS
    2) Go to Pending Orders
    3) Click on Accept Order
    4) There's the error

    P.S. I have recently changed the WHMCS install URL from http://epkhosting.com/myaccount to http://myaccount.epkhosting.com - something tells me that Connection Error refers to DNS... clientarea.php is not hosted on the remote server... it is part of WHMCS which is on the local server (myaccount.epkhosting.com)

    Please see attached screenshots.

  • WP Chef

    It seems to have been a DNS problem where my WHMCS server thought the WordPress server was on the same box... i discovered this by login to SSH and doing a dig like so

    # dig epkhosting.com 80

    It came back with the wrong IP address so i looked at the DNS records for the domain on the box and found that they were not set correctly.

    Then I started getting the green light on creating the module for each WHMCS account. But then somehow later it started saying;

    Order Accept Encountered Problems
    Invalid data or no response: The receiving plugin may not be activated at: http://epkhosting.com

    But the thing is... it works... I see that the module was successfully created when I look at the sites list in WordPress... the only downside here is that my product order in WHMCS cannot be marked as "Active" without fixing this error :slight_frown:

    Please advise,
    CP

  • Alexander

    Hi @epkhosting,

    I'm so sorry for the delay in getting back to you hear. I'm glad to hear you have it partially working. I've been testing some things out on my test network, I have the sites provisioning fine and I'm unable to reproduce the exact error.

    On the Wordpress side of things, can you enable error logging? One of the members here (Imperative Ideas) just posted a great tutorial on this here: https://premium.wpmudev.org/forums/topic/the-right-way-to-debug-php-in-wordpress

    I suspect that on the Wordpress side of things, it's unable to communicate back to your WHMCS installation, and thus can't confirm that the site was created. It gets created just fine because the request comes in, but it can't tell WHMCS about it when it's finished.

    Hopefully things are all set now on the WHMCS side, and we just need to figure out why Wordpress can't talk back.

    Also, can you try disabling the IP filtering? Just remove all IPs from the WHMCS Provisioning settings in Wordpress if you have any.

    Thanks for being a WPMU DEV member. I hope to help you resolve this quickly,
    Best regards,

  • WP Chef

    There are no IP filters in effect
    I have just enabled debugging mode

    I tried to place a new order and all I could find within the debug log was this;

    [06-Jun-2013 20:05:27 UTC] PHP Notice: Undefined index: pwd in /var/www/vhosts/ebizcard.ca/httpdocs/wp-content/plugins/wordfence/lib/wordfenceClass.php on line 548
    [06-Jun-2013 20:06:20 UTC] PHP Notice: Undefined index: pwd in /var/www/vhosts/ebizcard.ca/httpdocs/wp-content/plugins/wordfence/lib/wordfenceClass.php on line 548

    I then disabled the WordFence security plugin and still I get the same error; No Matching User Name Found

    What's next?

  • WP Chef

    Oh just had another look and found all this junk in the debug.log

    [06-Jun-2013 20:06:31 UTC] WordPress database error Unknown column 't2.post_type' in 'where clause' for query SELECT t1.* FROM ebizCard_2_postmeta t2 INNER JOIN ebizCard_2_postmeta t1 ON t2.ID = t1.post_id WHERE t2.post_type = 'page' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, WHMCS_Multisite_Provisioning->on_parse_request, WHMCS_Multisite_Provisioning->process_request, WHMCS_Multisite_Provisioning->create_blog, wpmu_create_blog, do_action('wpmu_new_blog'), call_user_func_array, blog_templates->set_blog_defaults, blog_templates->copy_posts_table
    [06-Jun-2013 20:09:38 UTC] WordPress database error Unknown column 't2.post_type' in 'where clause' for query SELECT t1.* FROM ebizCard_2_postmeta t2 INNER JOIN ebizCard_2_postmeta t1 ON t2.ID = t1.post_id WHERE t2.post_type = 'page' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, WHMCS_Multisite_Provisioning->on_parse_request, WHMCS_Multisite_Provisioning->process_request, WHMCS_Multisite_Provisioning->create_blog, wpmu_create_blog, do_action('wpmu_new_blog'), call_user_func_array, blog_templates->set_blog_defaults, blog_templates->copy_posts_table

    So what does this all mean?

  • Arnold

    It's a SQL query

    SELECT t1.* FROM ebizCard_2_postmeta t2 INNER JOIN ebizCard_2_postmeta t1 ON t2.ID = t1.post_id WHERE t2.post_type = 'page'

    The error is on the t2 table which is an alias for the ebizCard_2_postmeta table saying that t2.post_type is not a valid column, which is true. The post meta table only has meta_id, post_id. meta_key and meta_value.

    That's followed by the command stack to the final command that caused the error

    blog_templates->copy_posts_table

    This was being called as the result of trying to create the blog from the
    WHMCS_Multisite_Provisioning->create_blog,
    command, which then calls wpmu_create_blog, a standard Wordpress core call.

    This leads me to the "New Blog Templates" plugin which you are apparently using. I looked at version 1.7.2 which is the latest.

    On line 686 of the
    \wp-content\plugins\blogtemplates\blogtemplatesfiles\blog_templates.php
    is the offending SQL call and it looks like a straight out bug because it only uses the post_meta according to the call which doesn't contain the post_type table column. Something is going wrong in the building of that sql query.

    I'm going to turn this over as a New Blog Templates problem at this point and get that developer involved.

  • WP Chef

    I have updated the New Blog Templates plugin and I'm still getting the same errors. Even with the plugin disabled I get these errors;

    [11-Jun-2013 19:31:42 UTC] PHP Notice: Undefined index: nickname in /var/www/vhosts/ebizlynx.com/httpdocs/wp-content/plugins/whmcs-multisite-provisioning/whmcs-mrp.php on line 350

    [11-Jun-2013 19:31:49 UTC] WordPress database error Table 'ebizlynx_mu.ebizCard_31_icl_strings' doesn't exist for query SELECT id, value, status FROM ebizCard_31_icl_strings WHERE context='WP' AND name='Blog Title' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, WHMCS_Multisite_Provisioning->on_parse_request, WHMCS_Multisite_Provisioning->process_request, WHMCS_Multisite_Provisioning->create_blog, wpmu_create_blog, install_blog, update_option, do_action('update_option_blogname'), call_user_func_array, icl_st_update_blogname_actions, icl_st_update_string_actions

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.