sapi_windows_vt100_support |
Hi
When I try to run the command in the controller, I get this error. Am I doing something wrong, or is it a bug? PHP Code: <?php Code: TypeError
01-15-2025, 12:53 PM
(This post was last modified: 01-15-2025, 12:55 PM by captain-sensible. Edit Reason: the usual suspect )
not exactly sure what your trying to do, or your objective of running cron from inside CI4 but inside a controller this work ( on linux):
Code: echo shell_exec("ls"); for anything cron to work on Ci4 you can use cPanel to set up bash and php to run; so for instance you can clean out logs with a bash script set up from cPanel
According to the documentation, I can call the command anywhere in the code. https://codeigniter4.github.io/userguide...mands.html
The goal is to execute commands in CodeIgniter 4 (CI4) using crontab example : PHP Code: namespace App\Commands; PHP Code: php spark task:mytask This example works correctly But if I want to invoke a command from a controller - and I can because the documentation states that I can. Code: <?php
I don't have windows to check it, but it should work.
What windows/php version are you using?
Windows 11 , PHP 8.1.6
PHP Code: <?php Quote:when run from cli php index.php test I get cliVT100 is supported! and command works ok. When I run it from the browser http://ci.local/test a get sapi error Class CLI.php public static function streamSupports(string $function, $resource): bool $resource must by @param resource $resource i got string(12) "php://output" For now, I have created a workaround for the problem. PHP Code: <?php
How did I check it ?? I ask becouse i get
"Your PHP version must be 8.1 or higher to run CodeIgniter. Current version: 7.4.33" But I confirm that on another machine and with a different PHP version, it works correctly
That's an old project with CI 4.3.2.
Seems like your problem is related to the environment. |
Welcome Guest, Not a member yet? Register Sign In |