我试图安装扩展名mbstring但我有以下错误:
Error: Package: php-mbstring-5.4.16-23.el7_0.3.x86_64 (updates)
Requires: php-common(x86-64) = 5.4.16-23.el7_0.3
Installed: php-common-5.4.38-1.el7.remi.x86_64 (@remi)
php-common(x86-64) = 5.4.38-1.el7.remi
Available: php-common-5.4.16-21.el7.x86_64 (base)
php-common(x86-64) = 5.4.16-21.el7
Available: php-common-5.4.16-23.el7_0.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0
Available: php-common-5.4.16-23.el7_0.1.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0.1
Available: php-common-5.4.16-23.el7_0.3.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0.3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能解决这个问题?
谢谢你的帮助
我有这个自定义编译的PHP(v5.3.3),启用了以下扩展(通过configure):
./configure
--prefix=/usr/local/php5.3.3
--with-config-file-path=/usr/local/apache2/conf
--with-apxs2=/usr/local/apache2/bin/apxs
--with-bz2
--with-curl=/usr/lib
--with-curlwrappers
--with-freetype-dir=/usr/local
--with-gd=/usr/local
--with-gettext
--with-gmp
--with-iconv=/usr/local
--with-imap=/usr/local/imap2007e
--with-imap-ssl
--with-jpeg-dir=/usr/local/lib
--with-kerberos
--with-libxml-dir=/usr/lib
--with-mcrypt=/usr/local
--with-mhash
--with-mysql=/usr/lib/mysql
--with-mysql-sock=/var/lib/mysql/mysql.sock
--with-mysqli=/usr/lib/mysql/mysql_config
--with-openssl=/usr
--with-pcre-dir=/usr/local/lib
--with-pear
--with-png-dir=/usr/local/lib
--with-readline
--with-sqlite
--with-xmlrpc
--with-xsl=/usr/local
--with-zlib-dir=/usr/local/lib
--with-zlib=/usr/local
--without-pgsql
--enable-bcmath
--enable-calendar
--enable-exif
--enable-embedded-mysqli=shared
--enable-ftp
--enable-gd-jis-conv
--enable-gd-native-ttf
--enable-mbstring=all
--enable-mbregex
--enable-shared
--enable-sockets
--enable-soap
--enable-sqlite-utf8
--enable-zend-multibyte
--enable-zip
--disable-pdo
--disable-phar
Run Code Online (Sandbox Code Playgroud)
phpinfo()明确指出mbstring已启用:

有趣的是,当我尝试运行一些PHP脚本(SugarCRM更新)时,它会报告以下错误:
PHP致命错误:在第4165行的crm/include/pclzip/pclzip.lib.php中调用未定义的函数mb_strlen()
任何人都可以为这是为什么会发生这种情况以及如何解决这个问题?
谢谢,m ^ e
我需要在Apache/2.2.11(Fedora)上添加mbstring扩展到PHP 5.2.6的安装.我们启用了动态扩展,所以我认为我需要的是.so文件和.ini文件,对吗?我可以简单地删除这些文件并使其工作,还是我必须重新编译PHP?如果它只是上传和去,我在哪里可以得到我需要的文件?
在我的Symfony2应用程序上,我收到一个错误:
致命错误:在第18行的/Applications/MAMP/htdocs/application/vendor/bundles/FOS/UserBundle/Util/Canonicalizer.php中调用未定义的函数FOS\UserBundle\Util\mb_convert_case()
我使用的是PHP 5.3.6.
这是我的PHPInfo显示启用了mbstring:
http://i.stack.imgur.com/FCMDv.png
如果启用了mbstring,那么为什么找不到mb_convert_case?
当我尝试安装Laravel 5时,出现依赖性错误.我在Windows 7上使用Uniform Server.我启用了php_mbstring.dll,并检查了它是否正确加载.(我认为)
这是控制台输出(Composer):

这是我的php.ini中的扩展

这是phpinfo()mbstring的详细信息:

我不知道从哪里开始.任何的想法?
我从作曲家那里得到的错误信息是:您的要求无法解析为可安装的一组包.
Problem 1
- Installation request for laravel/framework v5.4.28 -> satisfiable by laravel/framework[v5.4.28].
- laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for phpunit/phpunit 5.7.21 -> satisfiable by phpunit/phpunit[5.7.21].
- phpunit/phpunit 5.7.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 3
- laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/tinker …Run Code Online (Sandbox Code Playgroud) 在PHP中计算UTF-8字符串的长度时,我使用mb_strlen().
例如:
if (mb_strlen($name, 'UTF-8') < 3) {
$error .= 'Name is required. Minimum of 3 characters required in name.';
}
Run Code Online (Sandbox Code Playgroud)
由于文本字段可以接受任何语言(多语言),我想确保PHP将正确计算mutltilanguage UTF-8字符.
这是足够的还是我需要使用其他方法?我担心PHP可能由于某种原因弄错了,或者我可能只是持怀疑态度,但我不希望人们绕过重要的验证,因为PHP错了.
我收到了错误
Call to undefined function FOS\UserBundle\Util\mb_convert_case() app_path/vendor/bundles/FOS/UserBundle/Util/Canonicalizer.php on line 18
Run Code Online (Sandbox Code Playgroud)
当我尝试加载灯具时会发生这种情况.
第一步是安装mbstring.so ext,所以我编译了php
--enable-mbstring
Run Code Online (Sandbox Code Playgroud)
比成功复制mbstring ext
phpize
./configure
make
make install
Run Code Online (Sandbox Code Playgroud)
并补充说
extension=mbstring.so
Run Code Online (Sandbox Code Playgroud)
到我的php.ini文件.不幸的是我仍然遇到了这个错误,php -m没有显示mbstring作为加载的扩展名.怎么了?
任何帮助将不胜感激.
PHP 5.4.7,Debian Lenny
来自php check.php输出
[[WARNING]] Checking that the mb_strlen() function is available: FAILED
*** Install and enable the mbstring extension ***
Run Code Online (Sandbox Code Playgroud) 我有UTF-8和mb_strtoupper的问题.
mb_internal_encoding('UTF-8');
$guesstitlestring='Le Courrier de Sáint-Hyácinthe';
$encoding=mb_detect_encoding($guesstitlestring);
if ($encoding!=='UTF-8') $guesstitlestring=mb_convert_encoding($guesstitlestring,'UTF-8',$encoding);
echo "DEBUG1 $guesstitlestring\n";
$guesstitlestring=mb_strtoupper($guesstitlestring);
echo "DEBUG2 $guesstitlestring\n";
Run Code Online (Sandbox Code Playgroud)
结果:
DEBUG1 Le Courrier de Sáint-Hyácinthe
DEBUG2 LE COURRIER DE S?INT-HY?CINTHE
Run Code Online (Sandbox Code Playgroud)
我不明白为什么会这样?我正在尝试尽可能小心地使用编码.该字符串首先作为UTF-8给出,经过验证并可能重新转换为UTF-8.这是一场噩梦!
UPDATE
所以我发现这是由于我通过控制台输入参数和从控制台返回的参数的组合引起的.所以他们在前进和出路的路上都是乱码.解决方案是不以这种方式输入任何参数,或以这种方式获取参数.
感谢大家帮忙解决这个问题!
所以我遇到了一个问题,我相信正在发生的事情是我正在接收使用一些unicode空间和一些ascii空间的数据,这样看起来相同的某些字符串并不相同,例如"防水"!="防水".这些字符串在我的数据库中显示不同,但是,当存在多字节字符时,通常会看到奇怪的字符:"防水"和"防水".
我想要一种方法使所有空格都是ascii空格,或者如果更容易,所有空格都是多字节空格.
我已经尝试过使用preg_replace,但是这些字符串不再像有效的多字节字符串那样读取了.(字符串中的多字节字符将显示为垃圾).
preg_replace('/[\pZ\pC]/',' ',$field);
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用mb_ereg_replace,但它没有效果.
mb_ereg_replace('/[\pZ\pC]/',' ',$field)
Run Code Online (Sandbox Code Playgroud) mbstring ×10
php ×10
laravel ×2
symfony ×2
utf-8 ×2
apache ×1
centos ×1
compilation ×1
composer-php ×1
debian ×1
fatal-error ×1
fedora ×1
install ×1
mamp ×1
multilingual ×1
unicode ×1
unix ×1
windows ×1