错误“未找到函数'mb_output_handler'"在Laravel [英] Error "function 'mb_output_handler' not found" in Laravel

查看:55
本文介绍了错误“未找到函数'mb_output_handler'"在Laravel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在php laravel 3.2项目文件夹中运行以下命令时

When I run following command in php laravel 3.2 project folder

php artisan key:generate

然后我收到此警告

警告:ob_start():在第32行的/Users/zafar/Sites/laravel-todo/laravel/core.php中找不到函数'mb_output_handler'或无效的函数名称

Warning: ob_start(): function 'mb_output_handler' not found or invalid function name in /Users/zafar/Sites/laravel-todo/laravel/core.php on line 32

在我的phpinfo.php中,我已经启用了mbstring.但是,当我执行php --ri mbstring时,它会显示Extension 'mbstring' not present..我怎么解决这个问题?我使用Mac OS X Lion 10.7.5.我使用此 http://php-osx.liip.ch/最近.

In my phpinfo.php, I already have mbstring enabled. However, when I do php --ri mbstring then it says Extension 'mbstring' not present.. How can I solve this problem? I use Mac OS X Lion 10.7.5. I upgraded my php to php 5.4.13 using this http://php-osx.liip.ch/ recently.

更新

在我的phpinfo文件中,php版本为PHP Version 5.4.13,但是当我执行php -v时,它显示以下输出

In my phpinfo file the php version is PHP Version 5.4.13 but when I do php -v it shows following output

PHP 5.4.11 (cli) (built: Jan 26 2013 20:10:19) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

更新2

当我运行php -i时,它将显示以下输出

when I run php -i then it shows following output

phpinfo()
PHP Version => 5.4.11

System => Darwin Zafars-MacBook-Pro.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
Build Date => Jan 26 2013 20:09:37
Configure Command =>  './configure' 
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,NTS
PHP Extension Build => API20100525,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports => tcp, udp, unix, udg
Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies


 _______________________________________________________________________


Configuration

Core

PHP Version => 5.4.11

Directive => Local Value => Master Value
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &

当我执行which php时,它给了我该路径/usr/local/bin/php,然后执行了/usr/local/bin/php -i,这给了我以下输出

And when I did which php it gives me this path /usr/local/bin/php and then I did /usr/local/bin/php -i which gives me following output

    phpinfo()
PHP Version => 5.4.11

System => Darwin Zafars-MacBook-Pro.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
Build Date => Jan 26 2013 20:09:37
Configure Command =>  './configure' 
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,NTS
PHP Extension Build => API20100525,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports => tcp, udp, unix, udg
Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies


 _______________________________________________________________________


Configuration

Core

PHP Version => 5.4.11

Directive => Local Value => Master Value
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &

更新3

运行/usr/local/php5/bin/php -i时,我得到以下输出

When I run /usr/local/php5/bin/php -i I get following output

PHP警告:PHP启动:无法加载动态库'/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/php-mbstring.dll'-dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/php-mbstring.dll,9):在第0行的未知"中找不到图片

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/php-mbstring.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/php-mbstring.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/php-mbstring.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/php-mbstring.dll, 9): image not found in Unknown on line 0
phpinfo()
PHP Version => 5.4.13

System => Darwin Zafars-MacBook-Pro.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
Build Date => Mar 19 2013 17:10:14
Configure Command =>  './configure'  '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-gd' '--with-ldap' '--with-xmlrpc' '--enable-exif' '--enable-soap' '--enable-sqlite-utf8' '--enable-wddx' '--enable-ftp' '--enable-sockets' '--with-bz2=/usr' '--enable-zip' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-mbstring' '--enable-bcmath' '--enable-calendar' '--with-iodbc' '--with-mhash' '--enable-fpm' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--enable-dtrace' '--with-iconv=/usr/local/php5' '--with-icu-dir=/usr/local/php5' '--with-mssql=shared,/usr/local/php5' '--with-pdo-dblib=shared,/usr/local/php5' '--with-libxml-dir=shared,/usr/local/php5' '--with-xsl=shared,/usr/local/php5' '--with-imap=../imap-2007f' '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--with-gettext=/usr/local/php5' '--with-curl=shared,/usr/local/php5' '--with-png-dir=/usr/local/php5' '--with-jpeg-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/php5' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5' '--with-tidy=/usr/local/php5' '--with-gmp=shared,/usr/local/php5' '--with-readline=shared,/usr/local/php5'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/php5/lib
Loaded Configuration File => /usr/local/php5/lib/php.ini
Scan this dir for additional .ini files => /usr/local/php5/php.d
Additional .ini files parsed => /usr/local/php5/php.d/10-extension_dir.ini,
/usr/local/php5/php.d/50-extension-apc.ini,
/usr/local/php5/php.d/50-extension-curl.ini,
/usr/local/php5/php.d/50-extension-gmp.ini,
/usr/local/php5/php.d/50-extension-igbinary.ini,
/usr/local/php5/php.d/50-extension-intl.ini,
/usr/local/php5/php.d/50-extension-mcrypt.ini,
/usr/local/php5/php.d/50-extension-memcache.ini,
/usr/local/php5/php.d/50-extension-memcached.ini,
/usr/local/php5/php.d/50-extension-mongo.ini,
/usr/local/php5/php.d/50-extension-mssql.ini,
/usr/local/php5/php.d/50-extension-oauth.ini,
/usr/local/php5/php.d/50-extension-pdo_dblib.ini,
/usr/local/php5/php.d/50-extension-pdo_pgsql.ini,
/usr/local/php5/php.d/50-extension-pgsql.ini,
/usr/local/php5/php.d/50-extension-readline.ini,
/usr/local/php5/php.d/50-extension-solr.ini,
/usr/local/php5/php.d/50-extension-twig.ini,
/usr/local/php5/php.d/50-extension-uploadprogress.ini,
/usr/local/php5/php.d/50-extension-xdebug.ini,
/usr/local/php5/php.d/50-extension-xhprof.ini,
/usr/local/php5/php.d/50-extension-xsl.ini,
/usr/local/php5/php.d/99-liip-developer.ini

PHP API => 20100412
PHP Extension => 20100525

推荐答案

啊,摘自文档您已引用:

php-osx不会覆盖Apple安装的php二进制文件,而是将所有内容安装在/usr/local/php5中.因此,新的php二进制文件位于/usr/local/php5/bin/php中.

php-osx doesn't overwrite the php binaries installed by Apple, but installs everyting in /usr/local/php5. The new php binary is therefore in /usr/local/php5/bin/php.

尝试在控制台上运行/usr/local/php5/bin/php -i,以查看已安装的内容.

Try running /usr/local/php5/bin/php -i at your console, to see what you have installed.

这篇关于错误“未找到函数'mb_output_handler'"在Laravel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆