PHP Fatal error: Call to undefined function bson encode()

Jmnote (토론 | 기여)님의 2014년 2월 3일 (월) 19:30 판 (→‎문제상황)
Fatal error: Call to undefined function bson_encode()

1 문제상황

[root@svn0 ~]# php -r "bson_encode();"
PHP Fatal error:  Call to undefined function bson_encode() in Command line code on line 1

Fatal error: Call to undefined function bson_encode() in Command line code on line 1

2 해결방법

[root@jmnote ~]# pecl install mongo
... (생략)
Build process completed successfully
Installing '/usr/lib64/php/modules/mongo.so'
install ok: channel://pecl.php.net/mongo-1.4.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
[root@jmnote ~]# echo "extension=mongo.so" > /etc/php.d/mongo.ini
[root@jmnote ~]# php -m | grep mongo
mongo
[root@jmnote ~]# php -r "bson_encode();"
PHP Warning:  bson_encode() expects exactly 1 parameter, 0 given in Command line code on line 1

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}