2013-05-19 58 views
5

當試圖與phpmyadmin.conf和失蹤的apache.conf

sudo /etc/init.d/apache2 restart 

啓動Apache我得到的錯誤

apache2: Syntax error on line 260 of /etc/apache2/apache2.conf: Could not open 
configuration file /etc/apache2/conf.d/phpmyadmin.conf: No such file or directory 
Action 'configtest' failed. 
The Apache error log may have more information. 
...fail! 

我應該怎麼辦?在互聯網上閱讀時,我還應該在/ etc/phpmyadmin中有一個名爲apache.conf的文件,但我沒有。

+0

我沒有任何示例文件。目前,無論我如何改變它,它是apache.conf缺少phpmyadmin或phpmyadmin.conf缺少apache2/conf.d – TheMeisterSE

+0

https://help.ubuntu.com/10.04/serverguide/phpmyadmin.html http:///packages.debian.org/experimental/all/phpmyadmin/filelist –

+0

http://ubuntuforums.org/archive/index.php/t-1613290.html –

回答

9

剛剛在Debian 7上遇到這個問題,安裝程序和dpkg-reconfigure phpmyadmin創建一個指向缺少文件的斷開鏈接「/etc/apache2/conf.d/phpmyadmin.conf」../../ phpMyAdmin的/的apache.conf」。不得不從舊的安裝中拷貝一份,在下面發佈。 Piotr,你的意見沒有用,不污染。

phpMyAdmin的默認的Apache配置

Alias /phpmyadmin /usr/share/phpmyadmin 

<Directory /usr/share/phpmyadmin> 
    Options Indexes 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_value include_path . 
    </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> 
+0

這是一個很棒的配置文件。我過去嘗試過很多,但都沒有正常工作。 – unixmiah

+0

我在phpmyadmin.conf中使用了別名' BeRocket

+0

在使用本教程安裝phpmyadmin後缺少phpmyadmin.conf,但此配置文件工作,謝謝。 – Manny265

1

檢查該文件夾/etc/apache2/conf.d存在,如果不創建它。

mkdir -p /etc/apache2/conf.d/ 

Apache2.conf文件包括從該文件夾中的所有文件到配置,如果該文件夾不存在,顯示了一個錯誤。

[email protected]:~$ cat /etc/apache2/apache2.conf | grep conf.d 
Include conf.d/ 

來源:與這一個

LockFile ${APACHE_LOCK_DIR}/accept.lock 

:在apache2.conf文件

Mutex file:${APACHE_LOCK_DIR} default 

https://askubuntu.com/questions/365454/apache2-error-could-not-open-configuration-file-etc-apache2-conf-d-no-such-fi

然後替換該行。

爲我排序。