DEV Community

The Builder
The Builder

Posted on

Can't Access Files in XAMPP "public" Folder on Linux? Fix Permissions with chmod

photo of pc screen showing termianl command with "ubuntu" and dollar sign as part of the command

Having trouble accessing your website files in XAMPP on Linux? The browser might not have read permissions. A simple fix is to adjust file permissions using chmod

Understanding File Permissions: The Key to Access

Your operating system controls how users and applications interact with files and folders. These permissions dictate who can view, edit, or execute them. In the case of XAMPP on Linux, the web server process (often running as the user "apache") needs permission to access your website files.

The Fix: Granting Read Access with chmod

Here's where the chmod command comes in. It allows you to modify file permissions. To grant read access to the web server process for your website files, follow these steps:

  1. Open a terminal window. You can find this by searching for "Terminal" in your applications menu.

  2. Navigate to the directory containing your website files. Use the cd command to change directories. For example, if your files are in a subfolder named "public" under your XAMPP htdocs directory, you would use cd /opt/lampp/htdocs/public. (Replace the path with your actual location).

  3. Run the chmod command. Here's the command to grant read (access) and execute (needed for some scripts) permissions for everyone (user, group, and others) on the public folder

    chmod 755 public

    (Replace the "public" with folder(s) name that you want to grant access).

  4. Check for change or restart XAMPP

  5. Open your web browser and attempt to access your website files. You should now be able to view them successfully.
    Important Note: While granting 755 permissions is common for website directories, it's crucial to understand file permissions and adjust them based on your specific security requirements.

By following these steps and comprehending the role of file permissions, you can ensure your XAMPP website files are accessible on Linux.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more