Difference between revisions of "PhpMyAdmin (Русский)"

From ArchWiki
Jump to: navigation, search
(Конфигурация)
(Конфигурация)
Line 58: Line 58:
 
</pre>
 
</pre>
  
Откройте файл {{Filename|'/etc/php/php.ini'}} и добавте в строчке 'open_basedir' следующие значения:
+
Откройте файл {{Filename|'/etc/php/php.ini'}} и добавьте в строчке 'open_basedir' следующие значения:
  
 
<pre>
 
<pre>

Revision as of 18:42, 20 March 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Перед установкой

Для начала прочитайте LAMP wiki, где детально расписана установка apache, php and mysql.

Инсталяция

Для инсталяции phpMyAdmin наберите в консоли.

pacman -S phpmyadmin php-mcrypt

Конфигурация

Первым делом нужно удалить старую папку phpmyadmin

rm -r /srv/httpd/phpMyAdmin

Скопируем пример конфигурационного файла в папку с настройками для httpd сервера

cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf

И добавим следующую строчку в /etc/httpd/conf/httpd.conf:

Include conf/extra/httpd-phpmyadmin.conf

Можно это сделать и в консоли, получится тот же самый эффект:

echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf

Закомментируем или удалим 'deny form all' в /usr/share/webapps/phpMyAdmin/.htaccess:

#deny from all

Чтобы не увидеть ошибку "Error 403 - Access forbidden!" при попытке открыть phpmyadmin

отредактируйте файл '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' как показано ниже:

Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"
        <Directory "/usr/share/webapps/phpMyAdmin">
                AllowOverride All
                Options FollowSymlinks
                Order allow,deny
                Allow from all
        </Directory>

Откройте файл Template:Filename и добавьте в строчке 'open_basedir' следующие значения:

:/usr/share/webapps/:/etc/webapps

Для примера, это может выглядеть так:

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps

Потом найдите строчку в Template:Filename:

 ;extension=mcrypt.so

и раскомментируйте ее

 extension=mcrypt.so

Access your phpmyadmin installation

You can access your phpmyadmin installation using the following url:

http://localhost/phpmyadmin/
or
http://localhost/phpmyadmin/index.php

Note: 'localhost' is the hostname in your /etc/rc.conf file.

If you want to access it using:

http://localhost/phpmyadmin

in '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' change:

Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"

to

Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"

You should also read this thread.

If you get the error "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)" then you might want to change "localhost" in /etc/webapps/phpmyadmin/config.inc.php on this line:

$cfg['Servers'][$i]['host'] = 'localhost';

to your hostname specified in /etc/hosts and /etc/rc.conf under HOSTNAME.

If you would like to use phpmyadmin setup script by calling http://localhost/phpmyadmin/setup you will need to create a config directory that's writeable by the httpd in the /usr/share/webapps/phpmyadmin as follows:

cd /usr/share/webapps/phpmyadmin
sudo mkdir config
sudo chgrp http config
sudo chmod g+w config

Other (Older) information

This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working

Things you should do first

Create a 'controluser', so that phpmyadmin can read from the main mysql database.

mysql -u root -pYOURROOTPASSWORD
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';

Where is phpmyadmin

in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik

ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin

Things you should change

controluser is set to controluser
controlpass is set to password
verbose is set to name_of_server

Sample 'config.inc.php' file

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com>
 * Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $
 * Date: Mon, 01 Sep 2008 20:34:02 GMT
 */

/* Servers configuration */
$i = 0;

/* Server ravi-test-mysql (http) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['controluser'] = 'controluser';
$cfg['Servers'][$i]['controlpass'] = 'password';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['verbose'] = 'name_of_server';

/* End of servers configuration */

$cfg['LeftFrameLight'] = true;
$cfg['LeftFrameDBTree'] = true;
$cfg['LeftFrameDBSeparator'] = '_';
$cfg['LeftFrameTableSeparator'] = '__';
$cfg['LeftFrameTableLevel'] = 1;
$cfg['LeftDisplayLogo'] = true;
$cfg['LeftDisplayServers'] = false;
$cfg['DisplayServersList'] = false;
$cfg['DisplayDatabasesList'] = 'auto';
$cfg['LeftPointerEnable'] = true;
$cfg['DefaultTabServer'] = 'main.php';
$cfg['DefaultTabDatabase'] = 'db_structure.php';
$cfg['DefaultTabTable'] = 'tbl_structure.php';
$cfg['LightTabs'] = false;
$cfg['ErrorIconic'] = true;
$cfg['MainPageIconic'] = true;
$cfg['ReplaceHelpImg'] = true;
$cfg['NavigationBarIconic'] = 'both';
$cfg['PropertiesIconic'] = 'both';
$cfg['BrowsePointerEnable'] = true;
$cfg['BrowseMarkerEnable'] = true;
$cfg['ModifyDeleteAtRight'] = false;
$cfg['ModifyDeleteAtLeft'] = true;
$cfg['RepeatCells'] = 100;
$cfg['DefaultDisplay'] = 'horizontal';
$cfg['TextareaCols'] = 40;
$cfg['TextareaRows'] = 7;
$cfg['LongtextDoubleTextarea'] = true;
$cfg['TextareaAutoSelect'] = false;
$cfg['CharEditing'] = 'input';
$cfg['CharTextareaCols'] = 40;
$cfg['CharTextareaRows'] = 2;
$cfg['CtrlArrowsMoving'] = true;
$cfg['DefaultPropDisplay'] = 'horizontal';
$cfg['InsertRows'] = 2;
$cfg['EditInWindow'] = true;
$cfg['QueryWindowHeight'] = 310;
$cfg['QueryWindowWidth'] = 550;
$cfg['QueryWindowDefTab'] = 'sql';
$cfg['ForceSSL'] = false;
$cfg['ShowPhpInfo'] = false;
$cfg['ShowChgPassword'] = false;
$cfg['AllowArbitraryServer'] = false;
$cfg['LoginCookieRecall'] = 'something';
$cfg['LoginCookieValidity'] = 1800;
?>