如何将YAML 1.1.1安装到php中


How to install YAML 1.1.1 into php

我想在cakephp2中使用yaml_parse_file()函数,但我有错误

"致命错误:在D:'Downloads'xampp'htdocs'carebody-2012-'app'Lib'RoadYaml.php中调用未定义函数yaml_parse_file() ".

我认为我有这个错误,因为我没有yaml在我的php。问题是我不知道如何安装我下载的yaml文件

如果使用的是apache2,请编辑文件/etc/php5/apache2/php.ini .

在动态扩展部分添加extension=yaml.so

完整示例:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; ... or with a path:
;
;   extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
extension=yaml.so