1

After installing the PHP Slim Framework in my new PHP 7.4 box (composer create-project slim/slim-skeleton:dev-master ta-api) and visiting the URL (https://my-domain.com/ta-api/public) I get the next JSON error message:

{
  “statusCode”: 500,
  “error”: {
    “type”: “SERVER_ERROR”,
    “description”: “ERROR: Module ‘sqlite3’ already loaded on line 0 in file Unknown.”
  }
}

What am I missing?

Marco Muciño
  • 620
  • 2
  • 9
  • 19
  • Does this answer your question? [PHP Warning: Module already loaded in Unknown on line 0](https://stackoverflow.com/questions/32764981/php-warning-module-already-loaded-in-unknown-on-line-0) – Nima Aug 19 '20 at 04:37
  • @Nima, no, I had already tried that solution but it could not solve my problem. I think maybe the Slim V.4 Framework has issues with the PHP V.7.4 – Marco Muciño Aug 20 '20 at 05:47

4 Answers4

5

I assumming you're using a ci framework. If it is, then you should open the index.php in the folder of your project, find

define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');

and change it to

define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production');

It's because your project is in development. So, you need to change it to "production".

Syscall
  • 19,327
  • 10
  • 37
  • 52
Kicap Karan
  • 51
  • 1
  • 3
2

Does seem to be the PHP version, I backed my PHP version to 7.3 and that error disappeared. On a previous test install (which I removed because of this problem) there were other PHP errors hopefully these are corrected now as well.

Rogo
  • 21
  • 2
1

I have same error after uploaded a codeigniter project to directadmin panel.

enter image description here

I found server php version is 7.4(current). Then I changed to php version to 7.3 . It worked for me.

infomasud
  • 2,263
  • 1
  • 18
  • 12
-2

Change your php version from 7.4 to 7.3 , it will be fixed