mbstring

phpMyAdmin Error: The mbstring extension is missing. Please check your PHP configuration

倖福魔咒の 提交于 2019-11-27 19:13:54
I have a problem running phpMyAdmin. When I try to access phpMyAdmin in my browser, I get the error message: "The mbstring extension is missing. Please check your PHP configuration." I have already searched on the internet for possible solutions. According to that, I made some modifications in php.ini file. I uncommented the line ";extension=php_mbstring.dll" and wrote the full path of the ext folder in extension_dir. Sadly, it still doesn't work. Could you please help me finding the proper solution. just run these command sudo apt-get install phpmyadmin php-mbstring php-gettext sudo service

Unable to call the built in mb_internal_encoding method?

谁都会走 提交于 2019-11-27 17:09:03
问题 I'm trying to install indefero on a CentOS 5.3 VMware 'box' and I ran into a problem. Quite early in the installation I get an error that I've been able to narrow down to this: [root@code /var/www/html]# cat x.php <?php mb_internal_encoding("UTF-8"); ?> [root@code /var/www/html]# php x.php PHP Fatal error: Call to undefined function mb_internal_encoding() in /var/www/html/x.php on line 2 I get the same error when calling this script via http through Apache. Now according to the PHP manual the

PHP Security: how can encoding be misused?

守給你的承諾、 提交于 2019-11-27 13:56:48
问题 From this excellent "UTF-8 all the way through" question, I read about this: Unfortunately, you should verify every submitted string as being valid UTF-8 before you try to store it or use it anywhere. PHP's mb_check_encoding() does the trick, but you have to use it religiously. There's really no way around this, as malicious clients can submit data in whatever encoding they want , and I haven't found a trick to get PHP to do this for you reliably. Now, I'm still learning the quirks of

Composer - the requested PHP extension mbstring is missing from your system [closed]

北慕城南 提交于 2019-11-27 10:04:04
问题 I've recently tried to install package through Composer, but I have got an error the requested PHP extension mbstring is missing from your system. I removed semicolon from php.ini , but it still doesn't work. What should I do? 回答1: sudo apt-get install php-mbstring # if your are using php 7.1 sudo apt-get install php7.1-mbstring # if your are using php 7.2 sudo apt-get install php7.2-mbstring 回答2: find your php.ini make sure the directive extension_dir=C:\path\to\server\php\ext is set and

Replacing invalid UTF-8 characters by question marks, mbstring.substitute_character seems ignored

▼魔方 西西 提交于 2019-11-27 09:44:39
I would like to replace invalid UTF-8 chars with quotation marks (PHP 5.3.5). So far I have this solution, but invalid characters are removed, instead of being replaced by '?'. function replace_invalid_utf8($str) { return mb_convert_encoding($str, 'UTF-8', 'UTF-8'); } echo mb_substitute_character()."\n"; echo replace_invalid_utf8('éééaaaàààeeé')."\n"; echo replace_invalid_utf8('eeeaaaaaaeeé')."\n"; Should output: 63 // ASCII code for '?' character ???aaa???eé // or ??aa??eé eeeaaaaaaeeé But currently outputs: 63 aaaee // removed invalid characters eeeaaaaaaeeé Any advice? Would you do it

utf8_(en|de)code removed from php7?

有些话、适合烂在心里 提交于 2019-11-27 08:32:44
I recently switched to PHP 7 on my development server, which has worked just fine - until now. Since I updated to PHP 7.0.3-10+deb.sury.org~trusty+1 (earlier today), the utf8_decode and utf8_encode functions are no longer accessible. They were, however, in previous versions of PHP7. When called, a fatal error is raised. I read that these functions are provided by the mbstring extension, which I checked with var_dump(extension_loaded('mbstring')); is loaded. How can I get the above functions to work again? Vladimir Korshunov I had the same problem. Just install php7.0-xml package. Ubuntu 16.04:

Multibyte trim in PHP?

依然范特西╮ 提交于 2019-11-27 07:47:57
Apparently there's no mb_trim in the mb_* family , so I'm trying to implement one for my own. I recently found this regex in a comment in php.net : /(^\s+)|(\s+$)/u So, I'd implement it in the following way: function multibyte_trim($str) { if (!function_exists("mb_trim") || !extension_loaded("mbstring")) { return preg_replace("/(^\s+)|(\s+$)/u", "", $str); } else { return mb_trim($str); } } The regex seems correct to me, but I'm extremely noob with regular expressions. Will this effectively remove any Unicode space in the beginning/end of a string? deceze The standard trim function trims a

phpMyAdmin mbstring error

﹥>﹥吖頭↗ 提交于 2019-11-27 04:23:21
问题 Whenever I try to enter my phpMyAdmin, it gives me this error: The mbstring extension is missing. Please check your PHP configuration. I've looked all over the Internet for a fix, but all I've found is errors similar to mine, but not the same, or the exact same but there was no fix given. I am also using Windows. 回答1: In Centos I have installed a php extension. I did this with: yum install php-mbstring 回答2: Before sometime I also had the same problem. I have tried replacing the .dll file but

PHP: Split multibyte string (word) into separate characters

家住魔仙堡 提交于 2019-11-27 02:12:44
问题 Trying to split this string "主楼怎么走" into separate characters (I need an array) using mb_split with no luck... Any suggestions? Thank you! 回答1: try a regular expression with 'u' option, for example $chars = preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY); 回答2: An ugly way to do it is: mb_internal_encoding("UTF-8"); // this IS A MUST!! PHP has trouble with multibyte // when no internal encoding is set! $string = "....."; $chars = array(); for ($i = 0; $i < mb_strlen($string); $i++ ) {

How to install PHP mbstring on CentOS 6.2

ε祈祈猫儿з 提交于 2019-11-26 16:14:41
How do I install mbstring with PHP on CentOS 6.2 I've tried: $ sudo yum install php-mbstring Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: mirror.net.cen.ct.gov * extras: centos.aol.com * updates: mirrors.seas.harvard.edu Setting up Install Process No package php-mbstring available. Error: Nothing to do But no packages were found? Tor P do the following: sudo nano /etc/yum.repos.d/CentOS-Base.repo under the section updates , comment out the mirrorlist line (put a # in front of the line), then on a new line write: baseurl=http://centos.intergenia.de/