I consciously updated codeigniter to version 4.3.1 from 4.1.3 using
composer update command because i need the RawSql function for seeding.
Then when i tried to start the server, its get some errors :
Code:
macpro@maulanaissaq ci4 % php spark serve
PHP Warning: Use of undefined constant ENVIRONMENT - assumed 'ENVIRONMENT' (this will throw an Error in a future version of PHP) in /Users/macpro/Documents/GitHub/ci4/vendor/codeigniter4/framework/system/CLI/CLI.php on line 666
Warning: Use of undefined constant ENVIRONMENT - assumed 'ENVIRONMENT' (this will throw an Error in a future version of PHP) in /Users/macpro/Documents/GitHub/ci4/vendor/codeigniter4/framework/system/CLI/CLI.php on line 666
CodeIgniter v4.3.1 Command Line Tool - Server Time: 2023-02-18 06:51:27 UTC+00:00
PHP Warning: Use of undefined constant CI_DEBUG - assumed 'CI_DEBUG' (this will throw an Error in a future version of PHP) in /Users/macpro/Documents/GitHub/ci4/vendor/codeigniter4/framework/system/Log/Logger.php on line 120
Warning: Use of undefined constant CI_DEBUG - assumed 'CI_DEBUG' (this will throw an Error in a future version of PHP) in /Users/macpro/Documents/GitHub/ci4/vendor/codeigniter4/framework/system/Log/Logger.php on line 120
CodeIgniter development server started on http://localhost:8080
Press Control-C to stop.
[Sat Feb 18 13:51:27 2023] PHP 7.4.33 Development Server (http://localhost:8080) started
Then when i open the brower it show :
Code:
Fatal error: Uncaught Error: Call to a member function run() on int in /Users/macpro/Documents/GitHub/ci4/public/index.php:37 Stack trace: #0 /Users/macpro/Documents/GitHub/ci4/vendor/codeigniter4/framework/system/Commands/Server/rewrite.php(47): require_once() #1 {main} thrown in /Users/macpro/Documents/GitHub/ci4/public/index.php on line 37
How to fix it?
I've been using 4.1.3 for long time and not update it