Opened 5 months ago

Last modified 2 days ago

#69930 accepted enhancement

php82-mysql, php83-mysql: Add mysql8 variant

Reported by: clouseau (John VanDyk) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc: radarhere (Andrew Murray)
Port: php82-mysql, php83-mysql

Description

The php81-mysql port has a variety of variants that include mutually exclusive libraries for mariadb, mysql57, mysql8, etc. These are are listed in the "Loaded plugins" row under the mysqlnd section of phpinfo().

The php82-mysql port has only debug and universal variants. The default variant does not install the auth_plugin_caching_sha2_password,auth_plugin_sha256_password mysqlnd plugins that are installed, for example, with port install php81-mysql +mysql8.

Thus, php82 with php82-mysql on MacPorts is currently not usable with MySQL 8 default password authentication (caching_sha2_password) resulting in "The server requested authentication method unknown to the client [caching_sha2_password]".

We would be grateful if a mysql8 variant of php82-mysql could be created.

Change History (10)

comment:1 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Port: php83-mysql added
Status: assignedaccepted
Summary: Add mysql8 variantphp82-mysql, php83-mysql: Add mysql8 variant

The MacPorts php82-mysql port installs both the mysqli and pdo_mysql extensions. Which one does your PHP code use?

As of PHP 8.2.0alpha3, trying to configure the mysqli extension to use an external MySQL client library produced this error:

configure: error: Linking mysqli against external library is no longer supported

I assumed that this also applied to pdo_mysql which was why I removed the MySQL variants for php82-mysql and later and forced the port to use mysqlnd—the built-in MySQL Native Driver—only.

However, I now see that for pdo_mysql the ability to use an external MySQL client library still exists, so I should reinstate the variants for that part. That won't help, of course, if your PHP code uses mysqli.

comment:2 Changed 5 months ago by clouseau (John VanDyk)

I'm using Drupal which uses PDO.

comment:3 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

In 29abb72a2c72b26e3a27711eb0aab0e635df3a01/macports-ports (master):

php82-mysql, php83-mysql: Reinstate mysql variants

I had removed the mysql variants as of 8.2.0alpha3 because I thought
using an external MySQL client library was no longer possible, but in
fact it was only no longer possible for mysqli; it is still possible
for pdo_mysql.

See: #69930

comment:4 Changed 5 months ago by clouseau (John VanDyk)

Thank you. However, with this change we are still at the point where installation results in missing plugins, so that PHP >8.1 on MacPorts does not support the default caching_sha2_password authentication method of MySQL 8.

Macports (port install php82-mysql +mysql8):

/opt/local/bin/php82 -i | grep 'Loaded plugins'
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password

Homebrew (brew install shivammathur/php/php@8.2):

/opt/homebrew/bin/php -i | grep 'Loaded plugins'
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password

RHEL 9.4 with PHP 8.2.13:

/usr/bin/php -i | grep 'Loaded plugins'
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password

comment:5 Changed 5 months ago by radarhere (Andrew Murray)

Cc: radarhere added

comment:6 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Right now mysql8 is broken due to #70001. Further investigation of this php issue will have to wait until that is resolved.

comment:7 Changed 4 months ago by radarhere (Andrew Murray)

Version 0, edited 4 months ago by radarhere (Andrew Murray) (next)

comment:8 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

My understanding now, after reading an extended FreeBSD discussion on this topic, is that php itself must be compiled with the openssl extension integrated in order for this to work. MacPorts currently offers the openssl php extension as a separately installable port, and this apparently is not sufficient for this to work. FreeBSD has removed their separately-installable openssl php extension package and integrated it into php for versions 8.0 and later. We could do that too; we already integrate some other essential extensions like xml. I would have to investigate what the situation is for earlier php versions. It may be that they cannot support this at all, in which case we might keep the separate openssl ports for those php versions.

comment:9 Changed 3 days ago by jmpalacios (Juan Manuel Palacios)

Hey @ryandesign! Has there been any progress on this? I'd be interested in getting it working, so let me know if I can help any.

Thanks!

comment:10 Changed 2 days ago by ryandesign (Ryan Carsten Schmidt)

I forgot about this ticket and didn't do anything about it, other than come to the conclusion that having openssl be a separate extension for some php versions and integrated for others would be confusing, so it should always be integrated, if that works for all php versions and if that solves this problem.

Note: See TracTickets for help on using tickets.