CodeIgniter Forums
Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 (/showthread.php?tid=67728)



Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - smhnaji - 04-02-2017

Hello

Dear all, while it's a lot of time that I'm using Codeigniter, it's my first time posting on the forums.

The problem is I cannot install Codeigniter on 2 different cpanel servers with different configurations, but both with PHP7.

In both of the error logs, I see the same error:


Code:
[Sun Apr 02 14:51:03 2017] [alert] [client XXX] /home/XXX/public/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration

Any ideas, friends? Rolleyes


RE: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - Narf - 04-02-2017

0 relation to CI.


RE: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - noobie - 04-02-2017

Try googling "Invalid command 'SetEnv'" maybe?


RE: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - smhnaji - 04-02-2017

Thank you for the help.

I'm following up the problem with my server provider.

Have a nice time


RE: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - smhnaji - 04-02-2017

According to https://bcit-ci.github.io/CodeIgniter4/general/environments.html that says

Quote:   This server variable can be set in your .htaccess file, or Apache config using SetEnv.


I have now commented out
Code:
SetEnv CI_ENV development
in .htaccess file and have defined the constant in my public/index.php file:

PHP Code:
define('ENVIRONMENT''development'); 


But I see the following error:


Code:
Fatal error: Default value for parameters with a class type hint can only be NULL in /home/XXX/system/Common.php on line 139


I think it shouldn't happen, should it?


RE: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - kilishan - 04-02-2017

That sounds like you're not running PHP 7. Please verify that you're host is actually running that for this domain.


RE: Cannot install CI4 on 2 different cpanel shared hosting servers and configs with PHP7 - smhnaji - 04-02-2017

Yes, you are right @kilishan, thank you.