# Fatal error: Uncaught TypeError: mb\_internal\_encoding()

**URL:** <https://discourse.cakephp.org/t/fatal-error-uncaught-typeerror-mb-internal-encoding/9889>\
**Category:** Need Help\
**Created:** [November 5, 2021, 4:05pm UTC](https://discourse.cakephp.org/t/fatal-error-uncaught-typeerror-mb-internal-encoding/9889 "2021-11-05T16:05:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cavatoni](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@cavatoni](https://discourse.cakephp.org/u/cavatoni)\
**Post date:** [November 5, 2021, 4:05pm UTC](https://discourse.cakephp.org/t/fatal-error-uncaught-typeerror-mb-internal-encoding/9889/1 "2021-11-05T16:05:56Z")

</div>

Hi,  
I’m getting this error :

**Fatal error** : Uncaught TypeError: mb\_internal\_encoding() expects parameter 1 to be string, null given in /var/www/html/project\_name/config/bootstrap.php:345.

I have this code there:

`mb_internal_encoding(Configure::read('App.encoding'));`

The code **`Configure::read('App.encoding')`** returns **null**

I’m using CAKEPHP 4.3 and PHP 7.2

Thanks!

---

<div class="post-metadata">

**Author:** ![cavatoni](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@cavatoni](https://discourse.cakephp.org/u/cavatoni)\
**Post date:** [November 5, 2021, 4:34pm UTC](https://discourse.cakephp.org/t/fatal-error-uncaught-typeerror-mb-internal-encoding/9889/2 "2021-11-05T16:34:32Z")

</div>

Hello,  
I fix it.  
I was missing the configuration attributes inside app.php:

```auto
    'App' => [
        'namespace' => 'App',
        'encoding' => env('APP_ENCODING', 'UTF-8'),
        'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
        'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
        'base' => false,
        'dir' => 'src',
        'webroot' => 'webroot',
        'wwwRoot' => WWW_ROOT,
        //'baseUrl' => env('SCRIPT_NAME'),
        'fullBaseUrl' => false,
        'imageBaseUrl' => 'img/',
        'cssBaseUrl' => 'css/',
        'jsBaseUrl' => 'js/',
        'paths' => [
            'plugins' => [ROOT . DS . 'plugins' . DS],
            'templates' => [ROOT . DS . 'templates' . DS],
            'locales' => [RESOURCES . 'locales' . DS],
        ],
    ],

```

Thanks!
