Welcome Guest, Not a member yet? Register   Sign In
Error after installing on shared hosting
#1

(This post was last modified: 07-14-2020, 11:15 AM by jreklund.)

After installing CI4 on shared hosting (Hostgator) I'm getting the following error:

Code:
Fatal error: Uncaught Error: Call to undefined function CodeIgniter\Autoloader\token_get_all() in /home1/*****/public_html/ci4/system/Autoloader/FileLocator.php:173 Stack trace:
#0 /home1/*****/public_html/ci4/system/Config/Config.php(150): CodeIgniter\Autoloader\FileLocator->getClassname('/home1/*****...')
#1 /home1/*****/public_html/ci4/system/Config/Config.php(83): CodeIgniter\Config\Config::createClass('Modules')
#2 /home1/*****/public_html/ci4/system/Common.php(127): CodeIgniter\Config\Config::get('Modules', true)
#3 /home1/*****/public_html/ci4/system/Config/BaseConfig.php(85): config('Modules')
#4 /home1/*****/public_html/ci4/system/Config/Config.php(124): CodeIgniter\Config\BaseConfig->__construct()
#5 /home1/*****/public_html/ci4/system/Config/Config.php(83): CodeIgniter\Config\Config::createClass('Config\\App')
#6 /home1/*****/public_html/ci4/system/Common.php(127): CodeIgniter\Config\Config::get('Config\\App', true)
#7 /home1/*****/public_html/ci4/system/bootstrap.php(176): config( in /home1/*****/public_html/ci4/system/Autoloader/FileLocator.php on line 173

Any help would be gretaly appreciated!
Reply
#2

Could you open up /home1/*****/public_html/ci4/system/Autoloader/FileLocator.php

And change line 173 from:
PHP Code:
$tokens     token_get_all($php); 

into:
PHP Code:
$tokens     = \token_get_all($php); 

And see if it works.
Reply
#3

Thanks for your Quick response!
I tried that and I'm getting this error stack now:

Code:
Fatal error: Uncaught Error: Call to undefined function token_get_all() in /home1/*****/public_html/ci4/system/Autoloader/FileLocator.php:173 Stack trace:
#0 /home1/*****/public_html/ci4/system/Config/Config.php(150): CodeIgniter\Autoloader\FileLocator->getClassname('/home1/*****...')
#1 /home1/*****/public_html/ci4/system/Config/Config.php(83): CodeIgniter\Config\Config::createClass('Modules')
#2 /home1/*****/public_html/ci4/system/Common.php(127): CodeIgniter\Config\Config::get('Modules', true)
#3 /home1/*****/public_html/ci4/system/Config/BaseConfig.php(85): config('Modules')
#4 /home1/*****/public_html/ci4/system/Config/Config.php(124): CodeIgniter\Config\BaseConfig->__construct()
#5 /home1/*****/public_html/ci4/system/Config/Config.php(83): CodeIgniter\Config\Config::createClass('Config\\App')
#6 /home1/*****/public_html/ci4/system/Common.php(127): CodeIgniter\Config\Config::get('Config\\App', true)
#7 /home1/*****/public_html/ci4/system/bootstrap.php(176): config('Config\\App')
#8 /home in /home1/*****/public_html/ci4/system/Autoloader/FileLocator.php on line 173
Reply
#4

You should contact your hosting provider then, as it appears you don't have Tokenizer installed.
https://www.php.net/manual/en/book.tokenizer.php
Reply
#5

I contacted my hosting provider and they confirmed it is installed. Is there anything else it may be?
Reply
#6

Create a single PHP-file and try an example:
https://www.php.net/manual/en/function.t...l-examples

If those dosen't work, it's not installed. And if they can't help you, change provider.
Reply
#7

(07-14-2020, 12:51 PM)jreklund Wrote: Create a single PHP-file and try an example:
https://www.php.net/manual/en/function.t...l-examples

If those dosen't work, it's not installed. And if they can't help you, change provider.

Does this issue have solution yet? i've tried deploying empty codeigniter project in hostgator just to see if it will run without my codes, but i'm still getting this error
Reply




Theme © iAndrew 2016 - Forum software by © MyBB