在尝试启动apache时
sudo /etc/init.d/apache2 restart我得到了错误
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的文件,但我没有。
发布于 2013-11-07 00:28:19
刚刚在Debian 7上遇到了这个问题,installer和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>发布于 2013-12-19 05:32:00
检查/etc/apache2/conf.d文件夹是否存在,如果不存在,则创建该文件夹。
mkdir -p /etc/apache2/conf.d/Apache2.conf文件将此文件夹中的所有文件都包含到配置中,如果此文件夹不存在,则会显示错误。
user@host:~$ cat /etc/apache2/apache2.conf | grep conf.d
Include conf.d/然后替换下面这一行:
LockFile ${APACHE_LOCK_DIR}/accept.lock使用这一条:
Mutex file:${APACHE_LOCK_DIR} default在apache2.conf文件中。
帮我整理好了。
https://stackoverflow.com/questions/16634466
复制相似问题