[MacPorts] #21437: The MAMP howto doesn't match the sample phpMyAdmin config file

Scott Haneda talklists at newgeo.com
Tue Sep 22 13:08:03 PDT 2009


On Sep 22, 2009, at 1:02 AM, Ryan Schmidt wrote:

>
> On Sep 21, 2009, at 15:01, Steve Meether wrote:
>
>> I finally got PhpMyAdmin to work.
>>
>> I tried several things and, to be honest, I'm not sure if it was  
>> one of those things are all of them together solved the issue.
>>
>> 1) in the config.inc.php I changed the following line:
>>
>> from:
>> $cfg['Servers'][$i]['host'] = 'localhost';
>>
>> to
>> $cfg['Servers'][$i]['host'] = '127.0.0.1';
>>
>>
>> I believe this is what allowed PhpMyAdmin to start working
>
> Changing the connection from localhost to 127.0.0.1 will cause the  
> mysql client in php to try to connect via TCP instead of via the  
> socket file. So if this fixed the issue for you, that suggests the  
> socket file was not at the place that PHP expected. Have you  
> configured the socket location properly in your php.ini? There are  
> three places to do it (one each for mysql, mysqli and pdo_mysql).

I have been following a little the phpMyAdmin thread on the list, I am  
not up to date on it, but wanted to chime in on this one, and seek  
clarification.

I have had to install apache2, mysql5, and php5 on a few machines, and  
reinstall lately.  It is no longer as smooth a process as it once was.  
In general, you followed the instructions in the output of macports,  
and had a working phpInfo() page in short order.

Now, all of a sudden, the socket has changed to MySql.  Why?  There  
are now three places you need to edit in php.ini to get this all  
working.  In the past, there were zero.  Personally, I do not see why  
the socket can not be in the default location that php is going to  
look for it.

Was this change a result of wanting to keep the socket in {prefix}  
instead of the default, which I believe is outside of prefix?  If that  
is the case, then why not set the socket path at build time of php so  
that it is now the default, and no editing of php.ini need be done?   
Or reinplace php.ini's conf files, though that does not solve it when  
there is no php.ini and we fall back on defaults.

I have done this 10 times over, and I still get hung up on it.

As to the phpMyAdmin, you do not want to change the localhost to an IP  
address, as it is not going to use socket, and as Ryan said, use tcp.   
Not sure the downside of that, but it is not needed.

I have sort of wondered about the phpMyAdmin port.  This is one of  
those ports that it may be a disadvantage to have as a port.  I would  
like to hear some comments on my reasoning...

Here is how I install phpMyAdmin
1) Download and uppack
2) change directory name to db-admin or similar
3) Upload those files to somewhere served by apache
	maybe example.com/db-admin
4) Edit the config samples one line of
	$cfg['blowfish_secret'] = 'random garbage here';
5) Rename the config file to config.inc.php

In this case, MacPorts affords you step 1, the rest of the steps, you  
either have to do on your own, or chose not to do in order for port  
update to work.  phpMyAdmin is a drag and drop install, managing it  
with ports may make your life harder, and impose limits on your  
install by forcing it to be in a location you may not like.

If you chose to want to access it at example.com/clients/db then you  
will have to learn mod_rewrite to make that happen.

I suppose there is value in those who are ok with it being installed  
where it is by default, and just want a simple way to manage and  
update things.

Can we discuss why this socket was changed?  I maintain and manage  
apache, mysql, and php daily, and am constantly boogered by this  
socket path change, which was something I never had to think about in  
the past.

Can php be changed to have a new internal socket path ref that is
${prefix}/var/run/${mysql}/mysqld.sock

Or would it be better to change the MySql port to use the socket path  
that php defaults to?

Or is there some way to port install mysql5 +socket=/where/php/is/ 
looking

I poked into trac to see if I could see when this change happened in  
mysql5, or if there was discussion on it.  I just do not know how to  
search in trac well enough to find the tickets as amazingly as you  
guys always do. :)

* Not complaining, love you guys, this one just struck me as an odd  
change in behavior, and one that was a non issue for me in the past.   
Everyone will get hung up on this, this opens the door to emails to  
the list that never were here before.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *



More information about the macports-dev mailing list