Welcome Guest, Not a member yet? Register   Sign In
Error: Undefined constant "CodeIgniter\CLI\STDERR"
#1

(This post was last modified: 11-24-2023, 05:47 PM by brabus.)

Hi, all, have been working on php spark, than i wanted to went to nginx, on first error got unwritable writable/cache, which solved by chmod 775, now I got that error: 

SYSTEMPATH/CLI/CLI.php
 at line 488
Have been looked in php.net/search engine did not found info about that const...  

New info: that was because i used: var_dump(command('logs:clear')); 

Seems I misunderstood and that function is only for CLI... Forgot i was used $migration->latest(); & cache()->clean();
Reply
#2

I don't recommend to use CLI command via web.
But If you really want to run it, try:
Code:
--- a/system/CLI/CLI.php
+++ b/system/CLI/CLI.php
@@ -180,6 +180,7 @@ class CLI
            // we need to define STDOUT ourselves
            // For "! defined('STDOUT')" see: https://github.com/codeigniter4/CodeIgniter4/issues/7047
            define('STDOUT', 'php://output'); // @codeCoverageIgnore
+            define('STDERR', 'php://output');
        }
    }
Reply




Theme © iAndrew 2016 - Forum software by © MyBB