gabordemooij / redbean

ORM layer that creates models, config and database on the fly
https://www.redbeanphp.com
2.31k stars 279 forks source link

Call to undefined function mb_strlen() #727

Closed c4tom closed 5 years ago

c4tom commented 5 years ago

Palm Sunday v5.3.1 PHP 7.2.19

PHP Fatal error: Uncaught Error: Call to undefined function RedBeanPHP\QueryWriter\mb_strlen() in /home/projetos/rb.php:6808

`$remoteAddress = $_SERVER['REMOTE_ADDR']; $geoLocationURL='http://www.geoplugin.net/php.gp?ip=' . $remoteAddress; $geoLocationResult = file_get_contents($geoLocationURL); $listaGeoLocation= unserialize($geoLocationResult);

R::setup('mysql:host=localhost;dbname=geo', 'root',''); $geo = R::dispense('geolocation'); $geo->geoplugin_request = $listaGeoLocation['geoplugin_request']; $geo->dataHora = new DateTime();

R::store($geo); R::close();`

Lynesth commented 5 years ago

The function mb_strlen() is not enabled by default in PHP.

If you can use apt just run this (or whatever works for your version): sudo apt install php7.2-mbstring

Please read the manual for more details: http://www.php.net/manual/en/mbstring.installation.php

marios88 commented 5 years ago

maybe it should be added on composer dependencies https://github.com/gabordemooij/redbean/blob/a5c4ff3adf570d26201ecd58d2f2eb929e9965dd/composer.json#L14

gabordemooij commented 5 years ago

Also explained on system requirements page: https://redbeanphp.com/index.php?p=/requirements

ngsoft commented 5 years ago

Hi, You can also use the command in your project: composer require symfony/polyfill-mbstring if you cannot install the extension