[MacPorts] #37452: php: add mysql variants to ${php}-mysql subports
MacPorts
noreply at macports.org
Tue Jan 22 22:57:33 PST 2013
#37452: php: add mysql variants to ${php}-mysql subports
--------------------------+--------------------------
Reporter: pc@… | Owner: ryandesign@…
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: php |
--------------------------+--------------------------
Comment (by ryandesign@…):
Replying to [comment:6 pc@…]:
> I think that the variant perhaps should be labelled - 'Use any Mysql
server on your system'. 'Native' in the Mac context means 'it's a Mac
thing' to me.
"MySQL Native Driver" is the name the PHP team have given to this feature.
"Native" in this case means without the use of any external library.
Any of the variants can be used to connect to any MySQL or compatible
server on your computer or any other computer, the only difference is what
libraries they use to do so. The only consequence is that if for example
you build php-mysql using +mysql51 but are connecting to a MySQL 5.5
server then possibly some new MySQL 5.5 features won't be available to
you.
These variants are left over from a time (PHP 4) before mysqlnd existed—if
you wanted to connect to a MySQL server, you ''had'' to build PHP with
MySQL libraries, and since we had multiple versions of MySQL in MacPorts,
we offered the user the choice; we didn't want to force the user to build
MySQL 5 if they already had MySQL 4 installed, or vice versa. Now that
mysqlnd exists and can communicate with any MySQL or compatible server
without the need for any MySQL libraries, I'm seriously considering
removing all the variants and making mysqlnd the only option.
> Two key bits of ignorance led me to believe that things were not working
- when they probably were:
>
> 'You may need to specify the socket address of the server in php.ini'.
> I've never had to do this before for a PHP installation probably because
the dedicated people who make things work have always done it for me. The
error message from mysqli_connect is less than helpful (Cannot find file
or some such) and it takes a bit of time to realise that it cannot find
the socket.
This is the one reason why I'm hesitant to remove the variants. If you
use, say, the mysql55 variant, then PHP is automatically configured to use
your local mysql55 server. This is not always what's wanted, and it can be
overridden by editing the php.ini or specifying the server connection
explicitly in your PHP code, but it's what's wanted often enough that it's
quite helpful.
But with mysqlnd, we don't know what server you're using, so you need to
edit the php.ini and tell it, or else specify the database connection
parameters in PHP (which is probably what you should be doing all the time
anyway).
> and
>
> 'Phpinfo will not tell you the version of your server, and will report a
possibly a lesser version of mysql provided by the mysqlnd client
library'. This fooled me into thinking that things were not working - when
they were.
Naturally. phpinfo() tells you the version of MySQL libraries used to
compile the PHP mysql module. It was never meant to tell you anything
about the version of MySQL running on your server.
--
Ticket URL: <https://trac.macports.org/ticket/37452#comment:7>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list