sh: 1: enabled: not found

Permalink
This error message appears in the server logs every time a concrete5 page loads. I'm curious what it is. I've read that its caused by a php script trying to execute shell commands. But what inside of c5 would be trying to execute shell commands?

ob7dev
 
ob7dev replied on at Permalink Best Answer Reply
ob7dev
So it wasn't c5 itself causing this error message to show up in my apache log.

First I tracked this down by doing a fresh install, no error. That means its a plugin causing it. I started going through plugins one by one and lo and behold!
public function on_start()
    {
        \Events::addListener(
            'on_page_view',
            function ($e) {
                $page = $e->getPageObject(); // get current page object
                // check if plugin is enabled
                $enabled = $pkg->getConfig()->get('plugin.enabled'); // check enabled value
                console.log(`enabled is ${enabled}`);
That code is from a packages controller, its on_start methods loads javascript into the view. But see that console.log line? Whats that doing there, thats javascript, and this is php. Well PHP was trying to do something with it none the less, and lo and behold: sh: 1: enabled not found!!!

Removing that line of code obviously fixed the problem.
Gondwana replied on at Permalink Reply
Gondwana
That line is probably an attempt at a debugging diagnostic. However, the debugging needed debugging (meta-debugging?). :)
ob7dev replied on at Permalink Reply
ob7dev
Yea its one my own add-ons. I must have been tired or something trying to do a javascript log from a php file, lol. So yes, the debugging needed debugging... or I just needed some sleep!
Gondwana replied on at Permalink Reply
Gondwana
I'm glad I wasn't (more) sarcastic in my previous reply, then. ;)

All these self-answers will be doing wonders for your karma! ;)