I’m getting the below error for my WordPress website immediately after installing Virtualmin. Website was working fine before. I’ve repeated this several times over by restoring my VM to its previous state. I just can’t work it out.
Some history. I have a new clean install of Ubuntu which I set up using Linode’s guides.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
LAMP stack. PHP 7.2. Firewall is UFW. Website still works after the install of Webmin but as soon as I install VirtualMin I get the below. Virtual min completes with no errors. Website still works fine … UNTIL I reboot and then it fails.
I’ve retried restart Apache2. Tried re-installing apache. I’ve checked the PHP ini files and they seem fine. Tried re-installing PHP and restarting it.
The PHP logs also show repeated errors like “PHP Warning: fopen(): Filename cannot be empty in” I"ve attempted to re-extract a copy of the Wordpress site files and it still doesn’t work
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
* @package WordPress
- Tells WordPress to load the WordPress theme and output it.
define( ‘WP_USE_THEMES’, true );
/** Loads the WordPress Environment and Template */
require( dirname( FILE ) . ‘/wp-blog-header.php’ );
Did you go through the Virtualmin Automated Install?
I setup a LAMP on my own and had this issue.
To rectify the issue, try:
sudo nano /etc/apache2/mods-enabled/dir.conf
Edit to look like this:
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
Then restart Apache2.
Mine looks like this
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
I changed it to look like yours but it didn’t work, even after reboot.
Any other suggestions?
Anyone else have any suggestions on this? Still got the problem
Ah okay, I found a solution.
Took a TAR copy of the entire apache2 folder before and after the VirtualMin install. Then FTP’d the tar files down to my PC, and extracted them.
Then used some software called Beyond Compare to compare both folders for file differences. Then went through and compared the contents of each file that had changed.
Most notable was a change to the /etc/apache2/mods-available/php7.2.conf file. The 2 lines near the top defining the SetHander were commented out. I clued onto this from a comment in another thread on another site. Removing the comments then restarting the apache server fixed the issues.
Hope this helps someone else.
# SetHandler application/x-httpd-php <<--- remove the comment
# SetHandler application/x-httpd-php-source <<--- remove the comment
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Require all denied
Not working if php-fpm ofcourse.