A modern, web-based file manager built with PHP featuring a beautiful UI, file operations, and permission management.
PHPFileManager is a lightweight, single-file web-based file manager that allows you to browse, upload, rename, and delete files and folders directly from your browser. Built with pure PHP and featuring a modern gradient UI, it provides a simple yet powerful interface for managing your server files with detailed permission and ownership information.
Perfect for developers, system administrators, or anyone who needs quick access to manage files on a PHP-enabled web server.
- π Browse Directories - Navigate through folders with detailed file information
- π€ Upload Files - Upload files directly through the browser
- βοΈ Rename Files & Folders - Easily rename any file or directory
- ποΈ Delete Operations - Delete files and directories (recursive deletion supported)
- π Create Folders - Create new directories on the fly
- π Permission Details - View file permissions in both symbolic and numeric formats
- π€ Ownership Info - See file owner and group information
- π₯οΈ Integrated Terminal - Execute file management commands directly from the web interface
- π¨ Modern UI - Beautiful purple gradient design with responsive layout
- β‘ Single File - Just one PHP file - upload and use immediately
- π‘οΈ Error Diagnostics - Detailed error messages with permission diagnostics
- π± Mobile Responsive - Works seamlessly on all devices
- PHP 7.0 or higher
- Web server (Apache, Nginx, or any PHP-compatible server)
- POSIX functions enabled (typically available on Linux/Unix servers)
- Download the
index.phpfile - Upload it to your web server directory
- Access via your browser:
http://yourserver.com/index.php
That's it! No configuration needed.
- Click on folder names to navigate into directories
- Use the "Back to Parent Folder" button to go up one level
- Current directory path is displayed at the top
- Enter a folder name in the "Create New Folder" field
- Click "Create Folder" button
- Scroll to the bottom upload section
- Click "Choose File" and select your file
- Click "Upload File" button
- Enter new name in the text field next to the file/folder
- Click the "Rename" button
- Click the "Delete" button next to any file or folder
- Folders will be deleted recursively with all contents
Click the "π₯οΈ Open Terminal" button to access the command-line interface for advanced file operations:
Navigation & Listing:
pwd- Print current working directorycd <directory>- Change directory (use..for parent,~for home)ls [directory]- List directory contents with permissionsdir [directory]- Alias for ls
Permission & Ownership Management:
chmod [-R] <permissions> <file>- Change file permissions (use-Rfor recursive)- Example:
chmod 755 file.txtorchmod -R 777 folder
- Example:
chown <owner> <file>- Change file owner
File Operations:
cat <file>- Display file contentstouch <file>- Create or update filecp <source> <destination>- Copy filemv <source> <destination>- Move or rename filerm <file>- Delete file
Directory Operations:
mkdir <directory>- Create new directoryrmdir <directory>- Remove empty directory
File Information:
file <file>- Show file type and MIME type
Help:
help- Show all available commands
# Change to a subdirectory
cd subfolder
# Go back to parent directory
cd ..
# List files in current directory
ls
# Change file permissions to 755
chmod 755 script.sh
# Recursively change permissions for entire directory
chmod -R 777 writable_folder
# Create a new file
touch newfile.txt
# Display file contents
cat file.txt
# Copy a file
cp original.txt backup.txt
# Return to home directory
cd ~IMPORTANT: This file manager provides direct access to your server's file system. Please consider the following:
- Restrict Access - Place the file in a password-protected directory or add authentication
- Use .htaccess - Limit access by IP address if possible
- File Permissions - Ensure proper file permissions on your server
- Delete After Use - Remove the file manager when not actively needed
- HTTPS - Always use over HTTPS to encrypt data transmission
AuthType Basic
AuthName "Protected Area"
AuthUserFile /path/to/.htpasswd
Require valid-userWhen you see permission errors, the file manager now provides detailed diagnostics including:
- Current directory and its permissions
- Script running user and directory owner
- Suggested fix commands
Quick Fix Using Terminal:
- Click "π₯οΈ Open Terminal" button
- Copy the suggested command (e.g.,
chmod -R 777 directory) - Paste and execute in the terminal
Manual Fix:
# Give www-data ownership (recommended)
sudo chown -R www-data:www-data /path/to/directory
# Or set broader permissions (less secure)
sudo chmod -R 777 /path/to/directory
# Or just make readable/writable for group
sudo chmod -R 755 /path/to/directoryUsing Terminal Commands:
# Quick permission fix via terminal
chmod -R 777 foldername
# Recursive permission change
chmod -R 755 foldername
# Change directory ownership
chown www-data:www-data filenameEnsure the PHP process has read permissions:
sudo chmod -R 755 /path/to/directoryOr use the integrated terminal:
chmod -R 755 foldernameCheck File Manager Diagnostics:
- The error message will show directory owner, current user, and permissions
- Check filename for invalid characters
- Verify available disk space
Check PHP upload settings in php.ini:
upload_max_filesize = 50M
post_max_size = 50MUsing Terminal to Debug:
# Check current directory
pwd
# List files with permissions
ls
# Check file size limits
touch testfile.txt
cat testfile.txt
rm testfile.txtUse the terminal to fix:
# Navigate to directory
cd foldername
# Change to full permissions
chmod -R 777 .
# Or make it group writable
chmod -R 775 .- Use the Terminal for bulk operations like
chmod -R 777 directoryname - Check Permissions regularly with
lsto understand your file structure - Backup Important Files before performing deletion operations
- Monitor Disk Usage when uploading large files
- Keep the Manager Secure - limit access with passwords/IP restrictions
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with pure PHP - no external dependencies
- Modern CSS3 gradients and animations
- Responsive design for all devices
If you encounter any issues or have questions, please open an issue on GitHub.
- Language: PHP 7.0+
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Lines of Code: ~1200
- Dependencies: None
- Size: ~35KB
- License: MIT
- β Added integrated web terminal with command support
- β
Implemented
cdcommand for directory navigation - β
Added
chmod -Rfor recursive permission changes - β
Implemented file operations:
cat,touch,cp,mv,rm - β
Added directory operations:
mkdir,rmdir - β
File type detection with
filecommand - β Enhanced error diagnostics with detailed permission info
- β Improved UI with beautified form styling
- β Responsive design improvements
- β Better error messages with suggested solutions
- File browsing and navigation
- Upload, rename, delete operations
- Permission and ownership display
- Beautiful gradient UI
- Responsive mobile design
β Star this repository if you find it helpful!
π‘ Tip: Bookmark this file manager URL for quick access to your server files!
- Toolbar: Enhanced folder creation form with better styling and spacing
- Upload Section: File input and button aligned horizontally for compact layout
- Terminal Modal: Dark theme terminal interface with responsive design
- Error Messages: Color-coded and detailed error diagnostics
- Button Styling: Improved button sizing and hover effects
- Mobile Responsive: Optimized for tablets and smartphones