CodeIgniter 4 not working on FreeBSD with PHP, PHP-FPM, Apache, and MySQL

I have uploaded a CodeIgniter 4 website that's working perfectly fine on web hosting and local server into a FreeBSD server running with PHP, PHP-FPM, Apache, and MySQL. The virtual hosts has been set up to use the 'public' directory as the root. But when accessing the website via the domain name connected to the server, it just returns a blank page and when checking the error logs of that specific domain. The following errors is shown:
Code:
[Tue Jul 11 14:24:59.845778 2023] [php:error] [pid 7796:tid 35550693376] [client 192.168.100.148:57487] PHP Fatal error:  Uncaught Error: Call to undefined function CodeIgniter\\Autoloader\\token_get_all() in /usr/home/ri/system/Autoloader/FileLocator.php:121\n
Stack trace:\n
#0 /usr/home/ri/system/Config/BaseService.php(371): CodeIgniter\\Autoloader\\FileLocator->getClassname()\n
#1 /usr/home/ri/system/Config/BaseService.php(261): CodeIgniter\\Config\\BaseService::buildServicesCache()\n
#2 /usr/home/ri/system/Config/BaseService.php(246): CodeIgniter\\Config\\BaseService::serviceExists()\n
#3 /usr/home/ri/public/index.php(54): CodeIgniter\\Config\\BaseService::__callStatic()\n
#4 {main}\n
  thrown in /usr/home/ri/system/Autoloader/FileLocator.php on line 121
When checking the php version using 'php -v' on terminal and 'phpinfo();' via PHP file, it is configured to use PHP 8.0.29 which is supported by CodeIgniter 4 and all the required extensions are also enabled. Especially the tokenizer extension which is what the error above is stating to be an undefined function. I have tried all possible ways to fix the error including trying a fresh installation of CodeIgniter 4, restarting php-fpm and apache, but still the same error is being returned.
 
If using packages you might need this:


If using ports rebuild with the TOKENIZER option selected (think it’s under php-extensions).
 
Nothing odd like disable_functions() in your php.ini?

If you write a small hello world test page outside of CodeIgniter can you get that to work under your web server?

If that works, add a call to function_exists with a function from tokenizer to see if it’s found.

If all working up to this point then something about CodeIgniter.
 
Back
Top