Multi-Site setup

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
wolfgtweb
Posts: 23
Joined: Thu Jun 10, 2021 6:15 pm

Multi-Site setup

Post by wolfgtweb »

I am thoroughly confused about how I can setup multi-site properly. Here is what I want to do. I have 3 FAQ sites I would like to setup and be managed under one instance of phpmyfaq.

domain.com
ack.domain.com
esign.domain.com

I installed phpmyfaq on domain.com and it works like it should. I tried to setup multi-site instances for the other two but it wasn't working. I figured out that the permissions on the multisite directory was not allowing apache to create the folders and files for the new instances. Fixed that. Now the folders are being created with two files in them (constants.php and database.php). Which is good. But still, I cannot get to the new URLs. Now I get Error 500 when trying to go to ack.domain.com. I have a feeling it is because I am entering something incorrectly into the multi-site form when creating the instance. But I can't find any instructions on what I am supposed to enter into those fields. Here is what I am entering.

Instance URL: [http://] ack [.domain.com] (this is forcing me to set to http even though it should be https. I have to edit it after creation)
Instance Path: ack.zfseit.com
Instance Name: Ack FAQ
Your admin email: me@email.com
Admin login name: gwolf
Admin password: private

But all I get is error 500 when I go to https://ack.domain.com. DNS and apache are setup properly. Any assistance is greatly appreciated.
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Multi-Site setup

Post by Thorsten »

Hi,

could you please enable the debug mode in src/Bootstrap.php and try it again. The cause of a 500 error should be visible then.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wolfgtweb
Posts: 23
Joined: Thu Jun 10, 2021 6:15 pm

Re: Multi-Site setup

Post by wolfgtweb »

Here is the error after debug is set to true. I don't know what parameter it is talking about (parameter 5 to be an integer).

[code]phpMyFAQ warning [2]: mysqli::__construct() expects parameter 5 to be integer, string given in /home/zfseit/html/src/phpMyFAQ/Database/Mysqli.php on line 72

phpMyFAQ warning [2]: mysqli::set_charset(): Couldn't fetch mysqli in /home/zfseit/html/src/phpMyFAQ/Database/Mysqli.php on line 81

phpMyFAQ warning [2]: phpMyFAQ\Database\Mysqli::error(): Couldn't fetch mysqli in /home/zfseit/html/src/phpMyFAQ/Database/Mysqli.php on line 101

Fatal error: Uncaught TypeError: Return value of phpMyFAQ\Database\Mysqli::error() must be of the type string, null returned in /home/zfseit/html/src/phpMyFAQ/Database/Mysqli.php:101 Stack trace: #0 /home/zfseit/html/src/phpMyFAQ/Database/Mysqli.php(82): phpMyFAQ\Database\Mysqli->error() #1 /home/zfseit/html/src/Bootstrap.php(130): phpMyFAQ\Database\Mysqli->connect('', 'wtgfaq', 'Redacted', 'phpmyfaq', '') #2 /home/zfseit/html/index.php(58): require('/home/zfseit/ht...') #3 {main} thrown in /home/zfseit/html/src/phpMyFAQ/Database/Mysqli.php on line 101[/code]
wolfgtweb
Posts: 23
Joined: Thu Jun 10, 2021 6:15 pm

Re: Multi-Site setup

Post by wolfgtweb »

If I am reading this correctly, below is line 72 in Mysqli.php. Parameter 5 is "$port". But port is set 7 lines earlier to 3306. Not something that is set by me or any configuration in the system.

[code]$this->conn = new \mysqli($host, $user, $password, null, $port);[/code]
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Multi-Site setup

Post by Thorsten »

Hi,

I fixed that issue some weeks ago, I checked the commits: https://github.com/thorsten/phpMyFAQ/commit/af9aa77b2ac5925988b4ec6307c6c6513e7d13ee

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wolfgtweb
Posts: 23
Joined: Thu Jun 10, 2021 6:15 pm

Re: Multi-Site setup

Post by wolfgtweb »

I just installed this. I assumed the "stable" version in the downloads section should be the way to go. So I should pull the current files from github?
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Multi-Site setup

Post by Thorsten »

Hi,

you are 100% right.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wolfgtweb
Posts: 23
Joined: Thu Jun 10, 2021 6:15 pm

Re: Multi-Site setup

Post by wolfgtweb »

I'll get right on that. While I work on that, can you confirm my values for the multi-site configuration? I have not been able to find an example of what I need to put in those fields. And since I have had this issue, I have changed the values so many times trying to fix the issue that I am unsure what they should be.
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Multi-Site setup

Post by Thorsten »

Hi,

your multi site setup looks good, is it working now with the fix above?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wolfgtweb
Posts: 23
Joined: Thu Jun 10, 2021 6:15 pm

Re: Multi-Site setup

Post by wolfgtweb »

Yes, Multisite is working well now.
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Multi-Site setup

Post by Thorsten »

Awesome!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply