Opened 15 years ago

Last modified 9 years ago

#21250 assigned enhancement

php53-mysql: default_socket should not be /tmp/mysql.sock

Reported by: cap10morgan@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Cc: anddam (Andrea D'Amore), nerdling (Jeremy Lavergne)
Port: php53-mysql

Description

php5-mysql should set the default_socket in the /opt/local/var/db/php5/mysql.ini file to the default mysql port location so that PHP and MySQL work out of the box together. I've attached a patch to do that.

Attachments (1)

add_default_socket.patch (371 bytes) - added by cap10morgan@… 15 years ago.
patch to add the 3 default socket settings to mysql.ini

Download all attachments as: .zip

Change History (14)

Changed 15 years ago by cap10morgan@…

Attachment: add_default_socket.patch added

patch to add the 3 default socket settings to mysql.ini

comment:1 Changed 15 years ago by blb@…

Owner: changed from macports-tickets@… to ryandesign@…

comment:2 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

That's not a bad idea. Unfortunately the php5extension portgroup does not yet offer the capability for the port to modify its ini file. The ini file is created by the portgroup in the post-destroot phase.

Currently the php5-mysql port just prints a message telling the user to set these php.ini values, if selecting the (default) +mysqlnd variant. If using one of the other methods -- +mysql5 or +mysql4 -- setting these values does not appear to be necessary. I am hopeful that setting these values will no longer be necessary for mysqlnd either, eventually; I thought this was a php bug but that bug has been closed so either the bug has been fixed (we should check in php 5.3.1) or it is a different bug report or it is not considered a bug.

comment:3 Changed 15 years ago by scott@…

Cc: scott@… added

Cc Me!

comment:4 Changed 15 years ago by scott@…

Sorry, I just posted this and randomly found this ticket.

Am I wrong in that this is as simple as just putting the compile options to php5 and Mysql5 to share the same socket path for defaults? This to me, would always be better than needing to edit any config file.

comment:5 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Status: newassigned

I do not want to force the user to edit a file. I just have not yet sufficiently investigated how to make that unnecessary.

comment:6 Changed 15 years ago by scott@…

Maybe the addition of this line is all that is needed? --with-mysql-sock=/var/run/mysqld/mysqld.sock \

Though it does look like it is in there --with-mysql-sock=${prefix}/var/run/mysql5/mysqld.sock but it is in a variant section

I am sure you understand how to solve this, and knowing it is on your radar is great. If there is anything I can lookup or test, let me know.

comment:7 in reply to:  6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to scott@…:

Maybe the addition of this line is all that is needed? --with-mysql-sock=/var/run/mysqld/mysqld.sock \

That's possible. I need to test it.

comment:8 Changed 15 years ago by anddam (Andrea D'Amore)

Cc: and.damore@… added

Cc Me!

comment:9 in reply to:  6 ; Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: php5-mysql 5.3.0 - Should set default_socket in mysql.iniphp5-mysql: default_socket should not be /tmp/mysql.sock

Replying to scott@…:

Maybe the addition of this line is all that is needed? --with-mysql-sock=/var/run/mysqld/mysqld.sock

Turns out this does not work for mysqlnd, and a PHP bug was filed for this problem.

#21581 is a duplicate of this bug.

comment:10 in reply to:  9 Changed 13 years ago by anddam (Andrea D'Amore)

Replying to ryandesign@…:

Turns out this does not work for mysqlnd, and a PHP bug was filed for this problem.

#21581 is a duplicate of this bug.

Seems the PHP bug you mentioned has been fixed, check last comment.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:11 Changed 13 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added

Cc Me!

comment:12 Changed 9 years ago by jmroot (Joshua Root)

Port: php53-mysql added; php5-mysql removed
Summary: php5-mysql: default_socket should not be /tmp/mysql.sockphp53-mysql: default_socket should not be /tmp/mysql.sock

comment:13 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: scott@… removed
Note: See TracTickets for help on using tickets.