PhpMyAdmin访问被拒绝#2002 Ubuntu,Lampp(Xampp for ubuntu)

问题描述 投票:-1回答:2

安装lampp(xampp for linux)之后,我得到了一些xampp新安全异常。为此,我更改了http-xampp.conf文件,如下所示

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

之后,我得到了拒绝访问权限的问题,如下所示:

Error
MySQL said: Documentation

#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured). 

Connection for controluser as defined in your configuration failed.

我已经从ubuntu论坛尝试了很多东西,但无法解决它。由于我是ubuntu的新手,我无法理解这些东西是如何工作的。请帮忙。

php mysql linux ubuntu phpmyadmin
2个回答
0
投票

所以我认为你应该这样做:

在/etc/apache2/conf.d/中创建一个文件phpmyadmin.conf

把它写到那个文件:

`

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext
    </IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>
    Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>

`


-1
投票

更改mysql的端口号。我的默认值是3306,该端口可能正在使用中,因此将端口号更改为3307或其他一些数字

© www.soinside.com 2019 - 2024. All rights reserved.