CodeIgniter Forums
Helpers not working after moving from Xampp to Linux server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Helpers not working after moving from Xampp to Linux server (/showthread.php?tid=85977)



Helpers not working after moving from Xampp to Linux server - bassmandc - 12-27-2022

I've moved my first CI4 project from Xampp to my Linux server tonight.  I followed the directory structure from the configuration documentation (where everything except the contents of the "/public" folder sits outside of public_html and the "/public" contents go in the public_html folder).  I kept the entire directory structure intact from the Xampp configuration.  I changed the baseurl.  Everything works except for pages that call custom Helper functions; it's saying those functions are undefined (but they work fine in the Xampp build).  Would anyone have any idea why the system wouldn't be finding / seeing the Helper functions in the new environment, even though the directory structure is identical and all other functionality works? 


RE: Helpers not working after moving from Xampp to Linux server - kenjis - 12-27-2022

Check the filename. Is all characters are lowercase like array_helper.php ?


RE: Helpers not working after moving from Xampp to Linux server - bassmandc - 12-27-2022

(12-27-2022, 10:45 PM)kenjis Wrote: Check the filename. Is all characters are lowercase like array_helper.php ?

Looks like that was the issue - thanks!  It's weird - some of the examples I saw in various places involved naming the custom Helper files with capitalized first word, underscore, then lowercase "helper.php" (e.g. Example_helper.php), but then calling the file all lowercase in the controller like this:  helper(example);  I just changed the file names to all lowercase and the errors are gone.  I appreciate it!


RE: Helpers not working after moving from Xampp to Linux server - kenjis - 12-27-2022

Linux file system is case sensitive. So if you code helper('example'), the filename must be example_helper.php.