Search code examples
phpcodeigniter

php spark serve Codeigniter 4 not working


I installed library from endroid's github (qr-code). When i was trying to do php spark serve, it said:

Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniter\CLI\Console::_
_construct() must be an instance of CodeIgniter\CodeIgniter, int given, called i
n D:\Kuliah\Magang\akses-log-data-center-itb\spark on line 49 and defined in D:\
Kuliah\Magang\akses-log-data-center-itb\vendor\codeigniter4\framework\system\CLI
\Console.php:29
Stack trace:
#0 D:\Kuliah\Magang\akses-log-data-center-itb\spark(49): CodeIgniter\CLI\Console
->__construct(1)
#1 {main}
  thrown in D:\Kuliah\Magang\akses-log-data-center-itb\vendor\codeigniter4\frame
work\system\CLI\Console.php on line 29

How do i fix this?


Solution

  • try this

    copy the index.php file in vendor/codeigniter4/framework/public/index.php (to) public/index.php

    then

    copy spark file in vendor/codeigniter4/framework/spark (to) root folder

    from: https://forum.codeigniter.com/printthread.php?tid=82087