coppermine-gallery.com/forum

Support => cpg1.6.x Support => cpg1.6 install => Topic started by: tonyofpureevil on October 13, 2019, 08:34:31 PM

Title: Where and how do you specify the mysql.sock location
Post by: tonyofpureevil on October 13, 2019, 08:34:31 PM
My installation is purely local on a laptop.
This means web server, mysql (mariadb), and php are all installed locally.
mysql is configured to not use networking, so socket communication is necessary.
the webserver is chrooted so I need to configure the socket in cpg1.6.06 as seen by the webserver
I have already configured phpMyAdmin and WordPress to work this way with no problem
None of the configuration tricks used by those applications work for Coppermine.
I can find no Coppermine documentation that shows how to do this.

help
Title: Re: Where and how do you specify the mysql.sock location
Post by: ron4mac on October 13, 2019, 11:45:36 PM
Just "localhost" doesn't work?
Title: Re: Where and how do you specify the mysql.sock location
Post by: tonyofpureevil on October 14, 2019, 02:39:02 AM
localhost does not work as mysql is configured with NO network access allowed.
Title: Re: Where and how do you specify the mysql.sock location
Post by: ron4mac on October 14, 2019, 02:58:40 AM
Use of 'localhost' with mysqli should open a UNIX socket.

https://www.php.net/manual/en/mysqli.quickstart.connections.php
Title: Re: Where and how do you specify the mysql.sock location
Post by: tonyofpureevil on October 14, 2019, 03:23:13 AM
Yes, but in the wrong location. Re-read OP
Title: Re: Where and how do you specify the mysql.sock location
Post by: tonyofpureevil on October 14, 2019, 03:26:16 AM
Oops! Replied too fast. The link in your post has the answer.  Will try and then report the result.
Title: Re: Where and how do you specify the mysql.sock location
Post by: ron4mac on October 14, 2019, 03:32:38 AM
Of course a default socket needs be set in PHP

Title: Re: Where and how do you specify the mysql.sock location
Post by: tonyofpureevil on October 14, 2019, 03:50:00 AM
Success!

edit /etc/php-7.3.ini
find the [MYSQLi] section and change default_host to localhost and default_socket to /your/path/to/mysql.sock
save the file and restart php73_fpm

In the Coppermine installer, blank the host field and enter your database username and password

Of course, this only works if you just have one application that uses the default values.
Fortunately, my other applications let me specify the socket location!