php5 +apache2 +mysql5 does not behave as expected SOLVED

Mark Duling mark.duling at
Thu Mar 22 10:34:18 PDT 2007

Elise van Looij <evlooij at> on Thursday, March 22, 2007 at 8:49 AM
-0800 wrote:
>Thank you very much to all who responded, and especially Ryan for his
>patience. Once I got my httpd.conf in proper shape, php worked fine, but
>mysql didn't. The problem was:
>error: 'Can't connect to local MySQL server through socket
>This was a problem others had wrestled with as well, I soon found out. It
>turned out I'd made two mistakes when installing mysql: I hadn't used the
>+server variant and I hadn't initialized the database. So I uninstalled
>php5 and mysql5, reinstalled mysql5 +server and followed the instructions
>in an old post by Ryan Schmidt on how install the main db:
>I then reinstalled php5 +apache2 +mysql5 and now they're all nice to each
>other once again. 

There are some hacks to for port authors to prevent this behavior I've
discovered.  I'd be interested to hear if there is a downside to this. 
But if you'd make an empty server variant for the php5 port (variant
server {}), and within the mysql5 variant use "variant_set server", then I
think that "port installed php5 +apache2 +mysql5" would install mysql as a
dependent using the server variant.  This is because when a port is
installed with a variant named "foo", all dependents that have variants
named "foo" are installed using the variant.


More information about the macports-users mailing list