🌟 We are Open Source! Check out our repository on GitHub

PHP Project Structure

A scalable and maintainable folder structure for PHP applications

File Structure

  • src
    • index.php
    • config.php
    • includes
      • functions.php
      • database.php
  • public
    • css
    • js
    • images
  • composer.json
  • README.md

Directory Structure Explanation

src/

The main source directory containing all PHP application code and logic.

index.php

The main entry point of the PHP application where requests are handled.

config.php

Configuration file containing application settings and constants.

includes/

Contains reusable PHP files that can be included across the application.

includes/functions.php

Common utility functions used throughout the application.

public/

Contains publicly accessible files like CSS, JavaScript, and images.

composer.json

Composer configuration file for managing PHP dependencies and autoloading.