Support > cpg1.6 install

mysqli and coppermine not seeing eye to eye

<< < (2/3) > >>

ron4mac:
Is this your own server?  That's a server setup issue. See how to configure the hosts file for localhost.

Understudy:
So...this one took some work. Working with a tech from Manchester, England the fbsd forums, and a lot of google-fu we have a solution. Some notes here. I understand and respect coppermine's position on personal servers but I want to try and do and be better. And sometimes the result is what will become a bug report that may have a small impact on everyone who use mariadb/php/coppermine. Some explanation will be given here for those who want a better understanding, solution will end up at the bottom. Devs can view this as they will.

The basics are in the first post. What the hunt for the issue involved: Issues with mariadb 10.5 and the decision to eliminate mysql.user they changed it. The lack of info in the my.cnf file specific to server settings, even if they have the [client-server] setup. We ended up doing basic parameters under [server] just to be sure. The big one is the bind-address and skip-networking. The bind-address is needed but the skip-network needs to be commented out. This makes sure that you can do either of these:


--- Code: ---mysql -h localhost -P 3306 -u username -p
mysql -h 127.0.01 -P 3306 -u brendhanhorne -p

--- End code ---
You need to be able to do both of those enter your password and see it come to a mysql prompt. If either of those don't work you probably have an issue with your my.cnf file.

Once you have those now we get into the heavy stuff. The issue on a step 7 of the coppermine install is that it asks for a mysqli connection with a user name and pass and then would fail despite that it would work at the command line. I needed to make sure this was not a coppermine issue (it wasn't and I didn't think it was). So I did an install of myphpadmin. When I attempted to log in I would get a similar error. With myphpadmin's version and codes.

Here is where things got fun, we could do coppermine with 127.0.0.1 instead of localhost but that is not desirable. But the reason was with myphpadmin was you can't do that unless you alter their config.inc.php file. Which would work but that is not a solution. That is a work around and coppermine can't be deployed on servers all over the world only to work with a band-aid. So we had to do better. After eliminating everything else including apache24 we were left with php74. Out of the frying pan into the fire.

The understanding is getting php to translate to localhost. And for this we have a fix that we are not sure if it is a band-aid because it may be different for FBSD vs Linux vs Windows.


Solution:

edit the following file:
/usr/local/etc/php/ext-20-mysqli.ini

Add the following lines:

--- Code: ---pdo_mysql.default_socket="/var/run/mysql/mysql.sock"
mysqli.default_socket="/var/run/mysql/mysql.sock"
--- End code ---

Now to submit bug reports. We will start with PHP but I am not sure where this will end up if anywhere.

phill104:
You should be able to edit your /etc/hosts file to add localhost.

Understudy:
It had been there the whole time. Sorry for not clarifying that.



--- Code: ---# $FreeBSD: releng/12.2/lib/libc/net/hosts 338729 2018-09-17 18:56:47Z brd $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
#::1                    localhost localhost.my.domain
127.0.0.1               localhost localhost.my.domain
#
--- End code ---

ron4mac:
In most implementations, I see something more like:


--- Code: ---127.0.0.1         localhost
127.0.1.1         localhost.my.domain

--- End code ---

And I've seen cases where it doesn't function correctly when configured as in your example.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version