# Preparations
# go to the CLI
# go to the `/system/cache` folder
# run the `sudo rm -Rf core modules themes` command (type your password if asked for) to delete all compiled templates
# in the IDE:
# open `/tools/run_event.php` for editing
# comment-out the `exit_code(1, 'This script needs to be enabled manually !');` line
# save changes
# Part 1 - web good
# login to the Admin Console
# go to the {nav Tools > System Tools} section
# use the `Clear` button in the `Clear Templates Cache` sub-section (will remove all files, but after the page is reloaded, the files for showing `System Tools` page will be compiled again)
# confirm that you're seeing green `Last operation has been successfully completed!` text without any errors
# Part 2 - cli bad
1. go to the CLI
2. run the `php tools/run_event.php adm:OnDeleteCompiledTemplates b674006f3edb1d9cd4d838c150b0567d` command
3. confirm that you're seeing this text (1st line is in red+bold), because you can't delete files in folders, owned by other users (folder owned by "apache", but you're deleting it as "user"):
```
Please manually delete paths:
1. /system/cache/core
```
4. confirm, that exit code from running `tools/run_event.php` script was a non-zero by checking the output of the `echo $?` command
# Part 3 - web bad
# go to the CLI
# run the `sudo chown root:root system/cache/core/admin_templates/incs` command (type your password if asked for) to change the owner of the folder, where compiled templates are stored
# login to the Admin Console
# go to the {nav Tools > System Tools} section
# use the `Clear` button in the `Clear Templates Cache` sub-section (will remove all files, but after the page is reloaded, the files for showing `System Tools` page will be compiled again)
# confirm that you're seeing this text (1st line is in red+bold), because you can't delete files in folders, owned by other users (folder owned by "root", but you're deleting it as "apache"):
```
Please manually delete paths:
1. /system/cache/core
```
# Part 4 - cli good
# go to the CLI
# run the `sudo chmod 777 -R system/cache` command (type your password if asked for) to make all compiled templates writable
# run the `php tools/run_event.php adm:OnDeleteCompiledTemplates b674006f3edb1d9cd4d838c150b0567d` command
# confirm, that:
* command produces no output
* exit code from running `tools/run_event.php` script was zero by checking the output of the `echo $?` command