2

I am testing CodeIgniter 4, but I am getting this error:

Fatal error: Default value for parameters with a class type hint can only be NULL in C:\xampp\htdocs\CodeIgniter4-develop\system\Config\DotEnv.php on line 121

What am I missing?

noufalcep
  • 3,446
  • 15
  • 33
  • 51
Waleed Ahmed Haris
  • 1,229
  • 11
  • 17
  • It is only a alpha version not ready yet still in development https://github.com/bcit-ci/CodeIgniter4 –  Jul 08 '16 at 21:08
  • 1
    So what's your code? The message is about some class hint where a default value of a param is not `NULL`, we probably can't say more from the message only. – YakovL Jul 08 '16 at 22:43
  • I would suggest posting issue on here https://github.com/bcit-ci/CodeIgniter4/issues/new –  Jul 09 '16 at 00:03
  • @wolfgang1983 OP should do some basic debugging first – charlietfl Jul 09 '16 at 02:10

3 Answers3

1

You Need PHP7 for codeigniter4.

If you need to test it you can even use any free hosting server like 000webhosting as i used.

Secondly download latest code from ci4 website now its refined.

Imran Qamer
  • 2,253
  • 3
  • 29
  • 52
0

Update your PHP Version to PHP7.

I was also encountered with this error but finally got the answer on Codeigniter Forum.

http://forum.codeigniter.com/thread-65773.html

Cody
  • 91
  • 1
  • 14
0

Codeigniter 4 requires php 7.

Verifying that, and then making sure CI works with a clean install from the git repo. Once you see the welcome page then you're good to go. If you are having issues with your own code, then please post that on here. Or post in the repo if you have found a bug in CI4.

Refer to the Documentation:

PHP version 7.0 or newer is required.

https://bcit-ci.github.io/CodeIgniter4/intro/requirements.html

Current GitHub Repo:

https://github.com/bcit-ci/CodeIgniter4

tmarois
  • 2,424
  • 2
  • 31
  • 43