0

I was using Code Igniter 3.0 with PHP 5.6.

After updating from Ubuntu 15.04 to 16.04, PHP was also updated from 5.6 to PHP 7.

I was using HMVC implementation of Code Igniter and PHP upgrade started throwing following errors:-

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Loader::library($library, $params = NULL, $object_name = NULL) should be compatible with CI_Loader::library($library = '', $params = NULL, $object_name = NULL)

Filename: MX/Loader.php

Line Number: 0
Jatin Dhoot
  • 4,294
  • 9
  • 39
  • 59

1 Answers1

2

The message pretty much explains your problem.

Try to find in your folder application/third_party/MX/ a file called Loader.php.

At line number 144 (or something like that) is a function called library

just replace your code with

public function library($library = '', $params = NULL, $object_name = NULL) 

and it should work again


However the weird thing here is - it looks like you use an old version of CI because the function of the current Version looks like

public function library($library, $params = NULL, $object_name = NULL)

as you can see here

i think after upgrading to PHP 7 you turned "display_errors" on because this error should also appear on PHP 5.6.x

Atural
  • 5,389
  • 5
  • 18
  • 35