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.
The configuration files are located in the /etc/phpmyadmin directory. The main configuration file is /etc/phpmyadmin/config.
The Apache Configuration file--located at /etc/apache2/conf/httpd. conf--should not be edited directly, as cPanel overwrites this file for many reasons.
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.
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With