{"id":350,"date":"2025-06-18T07:43:24","date_gmt":"2025-06-18T02:13:24","guid":{"rendered":"https:\/\/griffso.com\/blogs\/?p=350"},"modified":"2025-06-18T07:43:36","modified_gmt":"2025-06-18T02:13:36","slug":"fix-xampp-access-forbidden-403-error-on-localhost-windows-macos-linux","status":"publish","type":"post","link":"https:\/\/griffso.com\/blogs\/fix-xampp-access-forbidden-403-error-on-localhost-windows-macos-linux\/","title":{"rendered":"Fix XAMPP \u201cAccess Forbidden (403)\u201d Error on Localhost (Windows, macOS, Linux)"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Fix XAMPP \u201cAccess Forbidden (403)\u201d Error on Localhost<\/strong><\/h2>\n\n\n\n<p>Getting a \u201c403 Access Forbidden\u201d error in XAMPP on localhost? Learn how to fix permission and directory access issues on Windows, macOS, and Linux step-by-step.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde9 <strong>Introduction<\/strong><\/h3>\n\n\n\n<p>If you&#8217;re trying to access <code>http:\/\/localhost<\/code> or a project in your <code>htdocs<\/code> folder and see a <strong>\u201c403 Access Forbidden\u201d<\/strong> error, you&#8217;re not alone. It\u2019s a common issue caused by <strong>permissions<\/strong>, <strong>Apache configuration<\/strong>, or <strong>OS-level restrictions<\/strong>.<\/p>\n\n\n\n<p>This blog explains how to resolve it on <strong>Windows<\/strong>, <strong>macOS<\/strong>, and <strong>Linux\/Ubuntu<\/strong> machines.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2757 Common Causes<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Apache is denying access to directories due to configuration<\/li>\n\n\n\n<li>Wrong <code>httpd.conf<\/code> or <code>httpd-vhosts.conf<\/code> rules<\/li>\n\n\n\n<li>Incorrect folder permissions (especially on macOS\/Linux)<\/li>\n\n\n\n<li>OS security or antivirus blocking access<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udda5\ufe0f <strong>Fix on Windows<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step-by-Step:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open <code>httpd.conf<\/code> File:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Go to XAMPP Control Panel > Apache > Config > <code>httpd.conf<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Find the Directory Block:<\/strong><br>Look for: <code>&lt;Directory \/> AllowOverride none Require all denied &lt;\/Directory><\/code> Change to: <code>&lt;Directory \/> AllowOverride all Require all granted &lt;\/Directory><\/code><\/li>\n\n\n\n<li><strong>Check the <code>htdocs<\/code> Directory Block:<\/strong><br>Find: <code>&lt;Directory \"C:\/xampp\/htdocs\"> Options Indexes FollowSymLinks AllowOverride All Require all denied &lt;\/Directory><\/code> Change <code>Require all denied<\/code> to: <code>Require all granted<\/code><\/li>\n\n\n\n<li><strong>Save the file. Restart Apache.<\/strong><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf4f <strong>Fix on macOS<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step-by-Step:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open <code>httpd.conf<\/code>:<\/strong> <code>sudo nano \/Applications\/XAMPP\/xamppfiles\/etc\/httpd.conf<\/code><\/li>\n\n\n\n<li><strong>Update Directory Permissions:<\/strong><br>Find: <code>&lt;Directory \"\/Applications\/XAMPP\/xamppfiles\/htdocs\"> Options Indexes FollowSymLinks AllowOverride All Require all denied &lt;\/Directory><\/code> Change to: <code>&lt;Directory \"\/Applications\/XAMPP\/xamppfiles\/htdocs\"> Options Indexes FollowSymLinks AllowOverride All Require all granted &lt;\/Directory><\/code><\/li>\n\n\n\n<li><strong>Optional: Enable User Folder Access (if accessing custom folders):<\/strong> <code>&lt;Directory \"\/Users\/yourname\/Sites\"> Options Indexes FollowSymLinks AllowOverride All Require all granted &lt;\/Directory><\/code><\/li>\n\n\n\n<li><strong>Restart Apache:<\/strong> <code>sudo \/Applications\/XAMPP\/xamppfiles\/xampp restartapache<\/code><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udc27 <strong>Fix on Linux\/Ubuntu<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step-by-Step:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Edit Apache Config File:<\/strong> <code>sudo nano \/opt\/lampp\/etc\/httpd.conf<\/code><\/li>\n\n\n\n<li><strong>Update <code>htdocs<\/code> Directory Block:<\/strong> <code>&lt;Directory \"\/opt\/lampp\/htdocs\"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted &lt;\/Directory><\/code><\/li>\n\n\n\n<li><strong>Check File Permissions:<\/strong><br>Make sure your project folder is readable: <code>sudo chmod -R 755 \/opt\/lampp\/htdocs sudo chown -R $USER:www-data \/opt\/lampp\/htdocs<\/code><\/li>\n\n\n\n<li><strong>Restart Apache:<\/strong> <code>sudo \/opt\/lampp\/lampp restart<\/code><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 Bonus Tip: Disable Apache Security Block (if needed)<\/h3>\n\n\n\n<p>Sometimes, <code>mod_security<\/code> or <code>.htaccess<\/code> rules may block access. Temporarily comment them out if debugging.<\/p>\n\n\n\n<p>Also, ensure your antivirus\/firewall isn&#8217;t blocking Apache (common in Windows Defender).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccc Conclusion<\/h3>\n\n\n\n<p>The \u201c403 Access Forbidden\u201d error in XAMPP is typically due to default security settings in Apache. By updating directory permissions and Apache configuration, you can regain access to your local projects across any OS.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcac Still Facing the Issue?<\/h3>\n\n\n\n<p>Drop your Apache config block or a screenshot of the error in the comments, and I\u2019ll help you troubleshoot!<\/p>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"350\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"350\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Fix XAMPP \u201cAccess Forbidden (403)\u201d Error on Localhost Getting a \u201c403 Access Forbidden\u201d error in XAMPP on localhost? Learn how to fix permission and directory access issues on Windows, macOS, and Linux step-by-step. \ud83e\udde9 Introduction If you&#8217;re trying to access http:\/\/localhost or a project in your htdocs folder and see a \u201c403 Access Forbidden\u201d error, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-coding-help-programming-tips-code-examples-coding-resources-debug-guide-software-development-learn-to-code-coding-best-practices-coding-challenges-coding-tutorials"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":1,"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/posts\/350\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griffso.com\/blogs\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}