2013-03-30 234 views
2

「功能 'mb_output_handler' 未找到」 當我運行下面的命令在PHP laravel 3.2項目文件夾錯誤Laravel

php artisan key:generate 

然後我得到這樣的警告

警告:ob_start()函數「mb_output_handler」不/Users/zafar/Sites/laravel-todo/laravel/core.php在線32

在我的phpinfo.php的發現或無效的函數名,我已經有MBSTRING啓用。但是,當我做php --ri mbstring那麼它說Extension 'mbstring' not present.。我怎麼解決這個問題?我使用Mac OS X Lion 10.7.5。我最近使用這個http://php-osx.liip.ch/將我的php升級到php 5.4.13。

更新

在我的phpinfo文件中的PHP版本是PHP Version 5.4.13但是當我做php -v它顯示下面的輸出

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則顯示如下輸出

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這給了我下面的輸出

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我獲得以下輸出

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

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 
+0

我讀了某處(不記得在哪裏),你必須啓用php_mysql.dll和php_mysqli.dll。你有嗎? – bestprogrammerintheworld

+0

在phpinfo.php文件中啓用。但是用'php --ri mysql'和'php --ri mysqli'說'Extension'mysql'not present'和'Extension'mysql'not present' – 2619

+0

也許它不是關於mbstring。錯誤說「或無效的函數名稱」。看看core.php ...? – bestprogrammerintheworld

回答

0

啊,從the documentation你引:

PHP-OSX不會覆蓋蘋果公司安裝了PHP的二進制文件,但在/ usr /本地/ PHP5安裝everyting。新的php二進制文件因此位於/ usr/local/php5/bin/php中。

嘗試在您的控制檯上運行/usr/local/php5/bin/php -i以查看您已安裝的內容。

+0

請參閱我的第三個更新 – 2619

+0

我試過[這個搜索](https://www.google.co.uk/#q=php_osx+liip+Unable+to+load+dynamic+library+mbstring)和[got this] (https://github.com/liip/php-osx/issues/38)。有什麼好處? – halfer

+0

@ x4ph4r:你有多遠? – halfer