Difference between revisions of "Talk:PhpMyAdmin"

From ArchWiki
Jump to: navigation, search
m (deny from all (.htaccess for phpyadmin))
m
 
(16 intermediate revisions by 7 users not shown)
Line 1: Line 1:
'''I have just installed mysql, and I've got'''
+
== <s> deny from all (.htaccess for phpmyadmin) </s> ==
  
#mysql -u root
+
Commenting out 'deny from all' as the article states will allow ''everyone'' access. Wouldn't a safer way to do this be:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
+
deny from all
 +
allow from localhost
 +
allow from 192.168.1.0/24
 +
Or something to this extent? [[User:Axanon|Axanon]] 06:54, 19 June 2011 (EDT)
  
 +
::A note addresses your issue in the meantime. <span style="color:red">— [[User:Dinghy|Dinghy]] ([[User_talk:Dinghy|Talk]])</span> 20:57, 15 January 2016 (UTC)
  
'''Thanks to the wiki i've done:'''
+
== <s> Helpful info regarding config file, open_basedir, and a sample Nginx "sub-folder" </s> ==
  
General MySQL Connectivity
+
I ran into some issues while configuring. It took me a really long time to realize why my config.inc.php file wasn't being read after updating it.
  
Check /var/run/mysqld for mysqld.sock and /tmp for mysql.sock. If mysql.sock doesn't exist, create a softlink:
+
The Wiki page currently states:
  
# ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
+
Update open_basedir in /etc/php/php.ini and add "/usr/share/webapps/".
  
Then restart the daemon:
+
It should emphasize that /etc/webapps is needed. This is very important and I spent a lot of time debugging.
  
# /etc/rc.d/mysqld restart
+
The wiki page should mention that the configuration file is located in /etc/webapps/phpmyadmin (unless it already does. Maybe I overlooked it?)
  
 +
Also, here is a sample configuration for using PHPMyAdmin as a sub-folder instead of a document root. It assumes PHPMyAdmin is linked at /srv/http/phpmyadmin. This may not be perfect but it is working for me. It follows the current configuration instructions and doesn't stray away from them as far as I can tell.
  
'''But should the mysql package do this?'''
+
server {
 +
    location /phpmyadmin {
 +
        root          /srv/http/;
 +
        index          index.php;
 +
    }
 +
    location ~ ^/phpmyadmin.+.php$ {
 +
        root          /srv/http/; # Assumes PHPMyAdmin is linked at /srv/http/phpmyadmin
 +
        fastcgi_pass  unix:/var/run/php-fpm/php-fpm.sock;
 +
        fastcgi_index  index.php;
 +
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 +
        include        fastcgi_params;
 +
    }
 +
}
  
 +
--[[User:Kurtis|Kurtis]] ([[User talk:Kurtis|talk]]) 00:24, 6 May 2013 (UTC)
 +
:: This works for me. The main page wiki method gets me "not found". Thanks--[[User:Xan|Xan]] ([[User talk:Xan|talk]]) 14:51, 29 January 2015 (UTC)
 +
::: The PHP section now says "You need to make sure that PHP can access /etc/webapps. Add it to open_basedir in /etc/php/php.ini if necessary:...". Did you do that? [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 17:25, 29 January 2015 (UTC)
 +
::::If I recall well, I encountered this problem at some point. But this is fixed by default now that {{ic|open_basedir}} is not set anymore. <span style="color:red">— [[User:Dinghy|Dinghy]] ([[User_talk:Dinghy|Talk]])</span> 21:03, 15 January 2016 (UTC)
 +
I tried setting open_basedir "open_basedir=/etc/webapps" it caused a server error (500), we should add something about leaving it as is. [[User:Chrisfryer78|Chrisfryer78]] ([[User talk:Chrisfryer78|talk]]) 00:12, 20 January 2016 (UTC)
 +
== <s> PHP </s> ==
  
 +
When
 +
http://localhost/phpmyadmin/setup/ work properly but
  
== typo? ==
+
http://localhost/phpmyadmin/ start with "The mysqli/mysql extension is missing"
  
in the section that begins with;
+
please check on php.ini "mysqli.allow_persistent = On" and uncomment.
  
Use for PHP 5.x:
+
Restart httpd.
  
AddHandler php5-script php
+
{{unsigned| 13:05, 5 December 2014‎ |Tinosezc}}
  
to  
+
:{{ic|1=mysqli.allow_persistent = On}} is the default, not sure if this needs to be mentioned in [[PhpMyAdmin#PHP]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:19, 5 December 2014 (UTC)
  
AddHandler php5-script .php
+
::It is the default, probably came from a mangled configuration after port/update/edit. <span style="color:red">— [[User:Dinghy|Dinghy]] ([[User_talk:Dinghy|Talk]])</span> 21:00, 15 January 2016 (UTC)
  
:It's the same, see the official documentation: http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler
+
== <s> Reason of last config </s> ==
:"The extension argument is case-insensitive and can be specified with or without a leading dot." -- [[User:Kynikos|Kynikos]] 04:35, 4 June 2011 (EDT)
+
  
== deny from all (.htaccess for phpmyadmin) ==
+
Hi,
  
Commenting out 'deny from all' as the article states will allow ''everyone'' access. Wouldn't a safer way to do this be:
+
What's the purpose of [https://wiki.archlinux.org/index.php/PhpMyAdmin#Enabling_Configuration_Storage_.28optional.29 this section]? whem I login in with 'pma' user, I can't create databases (not enough privileges). Is not correct?--[[User:Xan|Xan]] ([[User talk:Xan|talk]]) 12:14, 1 February 2015 (UTC)
deny from all
+
 
allow from localhost
+
:Yes, that's correct, 'pma' is the username under which '''P'''hp'''M'''y'''A'''dmin gathers statistics and informations about relationships beyond what is built into MySQL. <span style="color:red">— [[User:Dinghy|Dinghy]] ([[User_talk:Dinghy|Talk]])</span> 00:11, 8 January 2016 (UTC)
allow from 192.168.1.0/24
+
Or something to this extent? [[User:Axanon|Axanon]] 06:54, 19 June 2011 (EDT)
+

Latest revision as of 00:12, 20 January 2016

deny from all (.htaccess for phpmyadmin)

Commenting out 'deny from all' as the article states will allow everyone access. Wouldn't a safer way to do this be:

deny from all
allow from localhost
allow from 192.168.1.0/24

Or something to this extent? Axanon 06:54, 19 June 2011 (EDT)

A note addresses your issue in the meantime. Dinghy (Talk) 20:57, 15 January 2016 (UTC)

Helpful info regarding config file, open_basedir, and a sample Nginx "sub-folder"

I ran into some issues while configuring. It took me a really long time to realize why my config.inc.php file wasn't being read after updating it.

The Wiki page currently states:

Update open_basedir in /etc/php/php.ini and add "/usr/share/webapps/".

It should emphasize that /etc/webapps is needed. This is very important and I spent a lot of time debugging.

The wiki page should mention that the configuration file is located in /etc/webapps/phpmyadmin (unless it already does. Maybe I overlooked it?)

Also, here is a sample configuration for using PHPMyAdmin as a sub-folder instead of a document root. It assumes PHPMyAdmin is linked at /srv/http/phpmyadmin. This may not be perfect but it is working for me. It follows the current configuration instructions and doesn't stray away from them as far as I can tell.

server {
   location /phpmyadmin {
       root           /srv/http/;
       index          index.php;
   }
   location ~ ^/phpmyadmin.+.php$ {
       root           /srv/http/; # Assumes PHPMyAdmin is linked at /srv/http/phpmyadmin
       fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
       fastcgi_index  index.php;
       fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
       include        fastcgi_params;
   }
}

--Kurtis (talk) 00:24, 6 May 2013 (UTC)

This works for me. The main page wiki method gets me "not found". Thanks--Xan (talk) 14:51, 29 January 2015 (UTC)
The PHP section now says "You need to make sure that PHP can access /etc/webapps. Add it to open_basedir in /etc/php/php.ini if necessary:...". Did you do that? Lonaowna (talk) 17:25, 29 January 2015 (UTC)
If I recall well, I encountered this problem at some point. But this is fixed by default now that open_basedir is not set anymore. Dinghy (Talk) 21:03, 15 January 2016 (UTC)

I tried setting open_basedir "open_basedir=/etc/webapps" it caused a server error (500), we should add something about leaving it as is. Chrisfryer78 (talk) 00:12, 20 January 2016 (UTC)

PHP

When http://localhost/phpmyadmin/setup/ work properly but

http://localhost/phpmyadmin/ start with "The mysqli/mysql extension is missing"

please check on php.ini "mysqli.allow_persistent = On" and uncomment.

Restart httpd.

—This unsigned comment is by Tinosezc (talk) 13:05, 5 December 2014‎ . Please sign your posts with ~~~~!

mysqli.allow_persistent = On is the default, not sure if this needs to be mentioned in PhpMyAdmin#PHP. -- Lahwaacz (talk) 13:19, 5 December 2014 (UTC)
It is the default, probably came from a mangled configuration after port/update/edit. Dinghy (Talk) 21:00, 15 January 2016 (UTC)

Reason of last config

Hi,

What's the purpose of this section? whem I login in with 'pma' user, I can't create databases (not enough privileges). Is not correct?--Xan (talk) 12:14, 1 February 2015 (UTC)

Yes, that's correct, 'pma' is the username under which PhpMyAdmin gathers statistics and informations about relationships beyond what is built into MySQL. Dinghy (Talk) 00:11, 8 January 2016 (UTC)