octobercms/october · error · ApplicationException

Safe mode is currently enabled that prevents PHP code change

Error message

Safe mode is currently enabled that prevents PHP code changes.

What it means

Error "Safe mode is currently enabled that prevents PHP code changes." thrown in octobercms/october.

Source

Thrown at modules/cms/classes/CmsCompoundObject.php:160

     * of the $settings property after the object is loaded from a file.
     * @return void
     */
    protected function parseSettings()
    {
        $this->fillViewBagArray();
    }

    /**
     * checkSafeMode checks if safe mode is enabled by config, and the code
     * attribute is modified and populated. If so an exception is thrown.
     * @return void
     */
    protected function checkSafeMode()
    {
        $safeMode = System::checkSafeMode();

        if ($safeMode && $this->isDirty('code') && strlen(trim($this->code))) {
            throw new ApplicationException(Lang::get('cms::lang.cms_object.safe_mode_enabled'));
        }
    }

    //
    // Components
    //

    /**
     * runComponents defined in the settings, this process halts
     * if a component returns a value.
     */
    public function runComponents()
    {
        foreach ($this->components as $component) {
            if ($result = $component->runLifeCycle()) {
                return $result;
            }
        }

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/cms/classes/CmsCompoundObject.php:160 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/6c6792684e9da6e8. Report an issue: GitHub.