Cannot log into phpmyadmin

Ryan Schmidt ryandesign at macports.org
Sat Jun 15 19:57:18 PDT 2013


On Jun 15, 2013, at 21:23, Rodolfo Aramayo wrote:

> Yes, UNIX socket (mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock)
> 
>  
> Perhaps there is a mismatch between where the MySQL server stores its socket file and where you've configured PHP to look for it. Have you changed where MySQL stores its socket, by editing the my.cnf file? If so, make the same change in the php.ini and/or the phpmyadmin config file.
> 
> 
> at php.in (development) I have:
> 
> mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock

Do you mean the file "php.ini-development" (which is an example file that you are not meant to modify and that PHP does not itself use) or do you mean the file "php.ini" (which you had at some point in the past copied from the "php.ini-development" example file)?


> I do not have my.cnf?? so I have not touched that file

Ok, no problem. Then your MySQL server is using its defaults and the socket file should be where it usually is.


> and at phpmyadmin I have:
> 
> /* Select mysql if your server does not have mysqli */
> $cfg['Servers'][$i]['extension'] = 'mysqli';
> $cfg['Servers'][$i]['AllowNoPassword'] = false;
> 
> this is related to mysql

Ok, so you've asked phpmyadmin to use the PHP mysqli extension.


>> Which PHP port are you using: php5, php53, php54, php55?
>  
> The ports related to php I have are:
> 
> 13# port installed php5*
> The following ports are currently installed:
>   php5 @5.3.26_0+apache2 (active)
>   php5-gd @5.3.26_0 (active)
>   php5-gdchart @0.2.0_0 (active)
>   php5-mailparse @2.1.6_0 (active)
>   php5-mbstring @5.3.26_0 (active)
>   php5-mcrypt @5.3.26_0 (active)
>   php5-mysql @5.3.26_0+mysqlnd (active)
>   php5-openssl @5.3.26_0 (active)
>   php5-zip @5.3.26_0 (active)
>   php53 @5.3.26_0+libedit (active)
>   php53-gd @5.3.26_0 (active)
>   php53-gdchart @0.2.0_0 (active)
>   php53-mailparse @2.1.6_1 (active)
>   php53-mbstring @5.3.26_0 (active)
>   php53-mcrypt @5.3.26_0 (active)
>   php53-openssl @5.3.26_0 (active)
>   php53-zip @5.3.26_0 (active)
>   php54 @5.4.16_0+libedit (active)
>   php54-apache2handler @5.4.16_0 (active)
>   php54-gd @5.4.16_0 (active)
>   php54-mbstring @5.4.16_0 (active)
>   php54-mcrypt @5.4.16_0 (active)
>   php54-mysql @5.4.16_0+mysqlnd (active)
>   php54-zip @5.4.16_0 (active)

Ok, so you have three separate MacPorts PHP worlds installed: the old php5 and the new php53 and php54. Which of these are you trying to use phpmyadmin with?


>> Which variant of the php5*-mysql port is installed? If mysqlnd, have you followed the instructions, e.g.:
> 
>   php5-mysql @5.3.26_0+mysqlnd (active)
>   php54-mysql @5.4.16_0+mysqlnd (active)
>  
> 
>> $ port notes php54-mysql
>> php54-mysql has the following notes:
>>  
>>   To use mysqlnd with a local MySQL server, edit /opt/local/etc/php54/php.ini and set mysql.default_socket, mysqli.default_socket and pdo_mysql.default_socket to the path to your MySQL server's socket file.
>> 
>>   For mysql5, use /opt/local/var/run/mysql5/mysqld.sock
>>   For mysql51, use /opt/local/var/run/mysql51/mysqld.sock
>>   For mysql55, use /opt/local/var/run/mysql55/mysqld.sock
>>   For mariadb, use /opt/local/var/run/mariadb/mysqld.sock
>>   For percona, use /opt/local/var/run/percona/mysqld.sock
> 
> I believe then I am using:
> 
> mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock

That's only the socket path for the PHP mysql extension, but above you showed that you had configured phpmyadmin to use the PHP mysqli extension. So that you'll be able to seamlessly use MySQL from PHP regardless of whether you're using the mysql, mysqli or pdo_mysql extensions, please set all three default socket paths to the correct value, as the notes of the php54-mysql port stated.


>> > Similarly, I cannot access:
>> >
>> > localhost/phpinfo.php
>> 
>> Why not? What happens?
> 
> Not Found!
> 
> Despite the fact that the phpinfo.php file is there in:
> 
> /opt/local/apache2/htdocs

Look in the apache error log. What does it say about this?


> BUT if I comment out the statement:
> 
> # Virtual hosts                                                                                                                                                                                           
> Include conf/extra/httpd-vhosts.conf
> 
> inside httpd.conf
> 
> then I can see phpinfo.php
> 
> 
> 
>> > If I turn conf/extra/httpd-vhosts.conf in the httpd.conf off I can now see the display of localhost/phpinfo.php,
>> 
>> What strange directives are in httpd-vhosts.conf that are causing that?
> 
> What I have found is that when I comment out the directive:
> 
> # Various default settings                                                                                                                                                                                
> Include conf/extra/httpd-default.conf
> 
> inside httpd.conf 
> 
> Now everything EXCEPT being able to see phpinfo.php works. 
> This is I can now see phpmyadmin and log into it correctly but phpinfo.php is not displayed correclty

Strange. The defaults should be fine, and some of them are probably kind of important to set. Can you isolate which of the settings in httpd-default.conf is causing the problem?


> Inside httpd-vhosts.conf I have the following active:
> #######
> NameVirtualHost *:80
> Listen 80
> 
> <VirtualHost localhost 192.168.1.5 165.91.108.63 *:80>
> ServerAdmin raramayo at gmail.com
> DocumentRoot "/opt/local/www/aramayolab"
> ServerName aramayolab.org
> ServerAlias www.aramayolab.org
> ErrorLog "/opt/local/www/aramayolab.logs/aramayolab.org.error.log"
> CustomLog "/opt/local/www/aramayolab.logs/aramayolab.org.access.log" common
> </VirtualHost>
> ######

The very first VirtualHost that you define for any given IP address becomes the default host for that IP address, which is used when a request comes in with an unrecognized hostname, overriding anything that was set globally in httpd.conf.


> Something tells me that I might be using different versions of php??

Which version of PHP are you intending to use with apache?




More information about the macports-users mailing list