For security, RISE never accepts PHP files (php, phtml, phar, inc and similar) as uploads. Support teams sometimes need these files from their customers, for example to check a broken script. You can now allow them in tickets only.
Turn it on
- Go to Settings > Tickets > Settings.
- Turn on Allow PHP files in tickets.
- Click Save.
After this, PHP files can be attached when a ticket is created, in ticket replies, in the embedded ticket form and in tickets created from emails (IMAP).
Other places (projects, tasks, file manager and so on) still don't accept PHP files.
How the files are kept safe
- The file is saved as a plain text file. For example, script.php is saved as script_php.code.txt. The server never sees a PHP file, so it can't run it.
- In the ticket, the file still shows its real name (script.php).
- When you download it, you get the original file with its real name.
- The files folder has a .htaccess file which blocks any PHP file there on Apache and LiteSpeed servers.
Nginx servers
Nginx doesn't read .htaccess files. The files are still safe because they are saved as text files. For extra safety, add this rule to your site's server block:
location ~* ^/files/.*\.(php\d?|phtml|pht|phar|phps|inc)(\.|$) {
deny all;
}