You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

XAMPP搭建WordPress遇500内部服务器错误及资源加载异常求助

Hey there, let's walk through how to fix this frustrating issue—when WordPress only loads core HTML without styles or content, it's almost always a path, permission, or server configuration problem. Here are the most effective troubleshooting steps tailored to your XAMPP setup on Windows:

Troubleshooting WordPress Styles & Content Loading Issues on XAMPP

1. Correct Your WordPress Site URL Settings

This is the #1 culprit for missing assets and broken content. If your site URLs are misconfigured, WordPress can't locate stylesheets, scripts, or post data.

  • Open phpMyAdmin from your XAMPP Control Panel, then navigate to your WordPress database.
  • Find the wp_options table, then look for the siteurl and home rows.
  • Ensure both are set to http://localhost/your-wordpress-folder (replace your-wordpress-folder with the actual name of your WordPress directory in XAMPP's htdocs folder).
  • If you can't access the admin dashboard to change these, add this directly to your wp-config.php file (in your WordPress root folder) to override:
    define('WP_HOME','http://localhost/your-wordpress-folder');
    define('WP_SITEURL','http://localhost/your-wordpress-folder');
    

2. Fix Windows File Permissions

Windows permissions can block Apache from accessing WordPress files properly, leading to missing assets.

  • Navigate to htdocs/your-wordpress-folder in File Explorer.
  • Right-click the folder > Properties > Security tab.
  • Make sure the user running Apache (usually SYSTEM or your Windows username) has Read & Execute, List folder contents, and Read permissions.
  • Click "Apply" and choose to propagate these permissions to all subfolders and files.

3. Enable Apache's Rewrite Module

WordPress relies on mod_rewrite for proper URL routing—even default permalinks can break if this module is disabled.

  • Open XAMPP Control Panel > Click "Config" next to Apache > Select httpd.conf.
  • Search for this line: #LoadModule rewrite_module modules/mod_rewrite.so
  • Remove the # at the start to uncomment it, save the file, then restart Apache.

4. Fix or Recreate the .htaccess File

A missing or corrupted .htaccess file can break asset loading and content routing.

  • Go to your WordPress root folder. If there's no .htaccess file (Windows hides files with leading dots—enable "Hidden items" in File Explorer), create a new one and paste these default WordPress rules:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /your-wordpress-folder/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /your-wordpress-folder/index.php [L]
    </IfModule>
    # END WordPress
    
  • Replace your-wordpress-folder with your actual directory name, then save the file as .htaccess.

5. Dive Deeper into Apache Error Logs

You mentioned checking logs—let's make sure you're targeting the right issues:

  • From XAMPP Control Panel, click "Logs" next to Apache > Open error.log.
  • Look for lines tagged [error] or [warn]:
    • "File not found" errors point to incorrect asset paths (double-check your site URLs).
    • "Permission denied" errors mean you need to fix folder/file permissions.
    • Rewrite-related errors confirm mod_rewrite isn't enabled properly.

6. Clear Cache & Disable Plugins/Themes Temporarily

Cached assets or faulty extensions can cause weird loading glitches:

  • Clear your browser cache and hard-reload the page (press Ctrl+F5 on Windows).
  • Rename the wp-content/plugins folder to plugins-disabled to turn off all plugins at once. If the site loads correctly, you know a plugin is the issue—enable them one by one to find the culprit.
  • Switch to a default theme like Twenty Twenty-Four by renaming your current theme folder in wp-content/themes—this rules out a broken theme causing the problem.

内容的提问来源于stack exchange,提问作者Max de Kroon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 08:55:44