基于 PHP 的轻量级文件编辑器和管理器
Pheditor is a single-file editor and file manager written in PHP.
Install using composer:
composer create-project pheditor/pheditor
or just upload pheditor.php to your web host (and/or rename it as you wish).
⚠️ Immediately after installing, change the default password (see NOTES below) before using any other feature.
By default Pheditor uses CDN to load required libraries but also it is possible to load assets from local directory.
For using local assets follow these steps:
pheditor.php and change LOCAL_ASSETS definition to true.define('LOCAL_ASSETS', true);
npm i to install required dependencies.Pheditor is a single-admin tool, conceptually similar to a local code editor (e.g. VSCode) exposed over HTTP for remote convenience. It intentionally allows creating, editing, and uploading files of any type — including .php files — because that is the core purpose of a code/file editor. This is a deliberate design decision, not an oversight: a file editor that couldn't edit or upload PHP files would not be useful for editing PHP projects.
Because of this, Pheditor should be treated as equivalent in sensitivity to direct SSH/FTP access to your server, and must never be exposed without proper protection. Specifically:
admin) is public knowledge (it's in this README and the source code). An instance left with the default password is equivalent to having no authentication at all.ACCESS_IP setting whenever possible, especially if the server has a static IP or VPN.PERMISSIONS to only what you actually need. If you don't need the terminal or upload features, remove terminal and uploadfile from the PERMISSIONS constant.If you are looking for a tool to expose to untrusted or semi-trusted users, Pheditor is not the right tool — it is built for a single trusted administrator only.
NOTES:
admin. This is publicly known and provides no real protection on its own — you must change it before or immediately after first login. Pheditor will prompt you to change it on first use, but the prompt alone does not protect the instance until the password is actually changed.Optional settings:
The settings would be editable in the main PHP file (pheditor.php by default). The settings are as below:
MAIN_DIR)EDITOR_THEME) (theme list)DEFAULT_DIR_PERMISSION and DEFAULT_FILE_PERMISSION)Using without password:
You can empty the PASSWORD constant in the source code to access the script without the password. This is strongly discouraged and should only be used in a fully trusted, isolated environment (e.g. localhost-only, behind a VPN with its own authentication) — never on a publicly reachable host.
Access Levels and Permissions:
There are eight permissions for users that is defined in PERMISSIONS constant. You can remove any of them as you need.
Default value: newfile,newdir,editfile,deletefile,deletedir,renamefile,renamedir,changepassword,uploadfile,terminal,movefile
If you're unsure which permissions to enable, start with a minimal set and add more only as needed — especially for terminal and uploadfile, which grant the most powerful capabilities.
Thanks to:
暂无开放 Issues,或尚未同步最近议题。