Jump to content

How to access one PW database in another PW site?


Recommended Posts

I have three secondary websites that get content from a related mothership website's database via the API - "multisites" or multiple instances with $config->useFunctionsAPI enabled and `new ProcessWire()` etc. 

This broke for mothership websites that were upgraded to PW version 3.0.198 dev; it still works fine for the one that is still on 3.0.169. If I edit the other secondary sites to get content from the v3.0.169 site, they work fine as well - but with the wrong content obviously...

With the v3.0.198 dev mothership sites, I now get error page 503 on the secondary websites that should get content via the API. The log says: 'Error:     Exception: Unrecognized operator: % (in /path_to_my_pw/wire/core/Selectors.php line 410)' - I can't find info where that problem starts. 

There is probably bad coding/syntax somewhere in my template files, but I can't pinpoint it. Any suggestions? What changed between 3.0.169 and 3.0.198 dev? What could cause 'Unrecognized operator: %'?

The selector error could be related to this?

Link to comment
Share on other sites

  • modifiedcontent changed the title to How to access one PW database in another PW site - broke between 3.0.169 and 3.0.198 dev

I am now starting to rebuild this from scratch. I have a main "mothership" site and want to display content from that site in a secondary site on the same server, with another URL. I had three sites working like this with a solution that involved $config->useFunctionsAPI that worked fine, until an upgrade somewhere between 3.0.169 and 3.0.198 dev.

Did anything change recently? Where are the current instructions for this? I see a lot of stuff about multisite, but that seems to be about managing multiple sites with different databases from the same admin etc. 

When I put this in my home.php template:

<?php

$forum = new ProcessWire('/home/bizpartn/public_html/mymothershipsite/site/', 'https://mymothershipsite.com/');

echo $forum;

?>

I get this error in the browser:

Quote

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

No error message in logs.

If I uses another site on a lower PW version, echo $forum outputs this in the browser:

Quote

ProcessWire 3.0.162 dev #1

I guess this was "multi-instance support", I originally worked on it here. Has it been deprecated/removed?

Link to comment
Share on other sites

  • modifiedcontent changed the title to How to access one PW database in another PW site?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...