Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpmyadmin.conf and apache.conf missing

When trying to start apache with

sudo /etc/init.d/apache2 restart

I get the error

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!

What should I do? When reading on the internet I should also have a file called apache.conf in /etc/phpmyadmin but I don't.

like image 600
TheMeisterSE Avatar asked May 19 '13 12:05

TheMeisterSE


People also ask

Where is phpMyAdmin config file Linux?

The configuration files are located in the /etc/phpmyadmin directory. The main configuration file is /etc/phpmyadmin/config.

Where is Apache Conf cPanel?

The Apache Configuration file--located at /etc/apache2/conf/httpd. conf--should not be edited directly, as cPanel overwrites this file for many reasons.


2 Answers

Just ran into this issue on Debian 7, installer and dpkg-reconfigure phpmyadmin create a broken link "/etc/apache2/conf.d/phpmyadmin.conf" which points to the missing file "../../phpmyadmin/apache.conf". Had to pull a copy off an older installation, posting below. Piotr, your comments were not useful, don't pollute.

phpMyAdmin default Apache configuration

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>
like image 161
Marc S Avatar answered Sep 20 '22 08:09

Marc S


Check if the folder /etc/apache2/conf.d exists, if not create it.

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

Apache2.conf file includes all files from this folder into the config, if this folder does not exist it shows an error.

user@host:~$ cat /etc/apache2/apache2.conf | grep conf.d
Include conf.d/

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

Then replace this line:

LockFile ${APACHE_LOCK_DIR}/accept.lock

with this one:

Mutex file:${APACHE_LOCK_DIR} default

in the apache2.conf file.

Sorted it out for me.

like image 26
Grant Avatar answered Sep 18 '22 08:09

Grant