Welcome Guest, Not a member yet? Register   Sign In
Call to undefined function CodeIgniter\Router\dot_array_search()
#1

Hello,
I have a project which recently upgraded to CI4 (4.3.1 to be precise). Everything works fine locally under Apache server and PHP 8.1.10, however, when I moved it to production environment, I got this:
PHP Code:
CRITICAL 2023-02-15 15:55:01 --> Call to undefined function CodeIgniter\Router\dot_array_search()
in SYSTEMPATH/Router/RouteCollection.php on line 1373.
 1 SYSTEMPATH
/Router/RouteCollection.php(914): CodeIgniter\Router\RouteCollection->create()
 
2 APPPATH/Config/Routes.php(31): CodeIgniter\Router\RouteCollection->get()
 
3 SYSTEMPATH/Router/RouteCollection.php(266): require('APPPATH/Config/Routes.php')
 
4 SYSTEMPATH/CodeIgniter.php(802): CodeIgniter\Router\RouteCollection->loadRoutes()
 
5 SYSTEMPATH/CodeIgniter.php(449): CodeIgniter\CodeIgniter->tryToRouteIt()
 
6 SYSTEMPATH/CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest()
 
7 FCPATH/index.php(67): CodeIgniter\CodeIgniter->run() 
In Routes.php 31 line is:
PHP Code:
$routes->get('/''Login::index'); 

Production PHP version is 8.1.15 (also tried 7.4.33 - same issue). Since it works locally but doesn't on prod, I assume everything is ok with CI itself (right?), but I'm not a server guy, and from this error I have no idea what's wrong... Maybe you have any ideas?
Reply
#2

dot_array_search() is defined in system/Helpers/array_helper.php.
Check if the file is uploaded.
Reply
#3

(02-15-2023, 05:01 PM)kenjis Wrote: dot_array_search() is defined in system/Helpers/array_helper.php.
Check if the file is uploaded.

Thank you, your message gave me the idea - yes, the file was there, but I noticed that folder was lowercase (system/Helper and system/Config was lowercase - Github messed up the cases). It works now when I made it uppercase, thank you again!
Reply
#4

Okay, good!

If your app runs on local PC or mac, but does not run on the Linux server,
the most common reason is the difference in lower and upper case filenames.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB