Virtualmin安装WordPress后install.php无法访问的问题求助
Hey there, let's work through this issue step by step—this is a common hiccup with Virtualmin's script installer, and I’ve fixed it a bunch of times before. Here are the most likely causes and fixes:
1. Verify WordPress Files Actually Exist
First, let’s confirm the install.php file is where it’s supposed to be. You can do this two ways:
- Via Virtualmin File Manager: Log into Virtualmin, navigate to your virtual host, click
File Manager, and check thepublic_html/wordpress/wp-admindirectory. Ifinstall.phpis missing, the script installer probably failed to deploy all files (even if it said it succeeded). - Via SSH: Connect to your server and run this command (replace
yourdomainwith your actual domain):ls -la /home/yourdomain/public_html/wordpress/wp-admin/install.php
If the file doesn’t exist, skip to step 5 to reinstall WordPress via the script.
2. Check Your Virtual Host’s Document Root
Virtualmin might be pointing to the wrong directory for your website. Here’s how to fix it:
- In Virtualmin, go to your virtual host >
Server Configuration>Website Options. - Look for the
Document rootfield. If you installed WordPress inpublic_html/wordpress, you have two options:- Change the document root to
/home/yourdomain/public_html/wordpress(so your site loads directly from the WordPress folder), or - Move all WordPress files from
public_html/wordpresstopublic_html(the standard setup for most sites).
- Change the document root to
- After making changes, restart your web server:
- For Apache:
sudo systemctl restart apache2 - For Nginx:
sudo systemctl restart nginx
- For Apache:
3. Fix File Permissions
Incorrect permissions are a frequent culprit—Virtualmin sometimes sets permissions that prevent the web server from reading files. Run these commands via SSH (replace yourdomain):
# Set correct owner for all WordPress files chown -R yourdomain:yourdomain /home/yourdomain/public_html/wordpress/ # Set file permissions to 644 (readable by web server) find /home/yourdomain/public_html/wordpress/ -type f -exec chmod 644 {} \; # Set directory permissions to 755 (accessible by web server) find /home/yourdomain/public_html/wordpress/ -type d -exec chmod 755 {} \;
4. Check URL Rewrite Configuration
If you’re using Apache, make sure the .htaccess file in your WordPress directory has the correct rewrite rules. It should look like this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule> # END WordPress
If you’re using Nginx, add this block to your virtual host’s configuration file (under the server section):
location /wordpress { try_files $uri $uri/ /wordpress/index.php?$args; }
Don’t forget to restart your web server after editing these files.
5. Reinstall WordPress via Virtualmin Scripts
If none of the above works, the script installer might have had an unseen error. Go back to your virtual host in Virtualmin, click Install Scripts, find WordPress in the list, and select Reinstall. Double-check that the installation path is correct (either public_html or public_html/wordpress) before starting.
内容的提问来源于stack exchange,提问作者def_not_tom

