duanquan4451 2017-03-25 23:04
浏览 413

如何在Mac上安装PECL YAML Extension?

My goals is to be able to use the PHP functions for parsing YAML detailed in the PHP docs: http://php.net/manual/en/ref.yaml.php

To install the PECL yaml extension I've opened Terminal and typed:

brew install libyaml

Then

sudo /usr/local/php5/bin/pecl install pecl_http

Then

sudo /usr/local/php5/bin/pecl install yaml

But I think it fails to install the PECL yaml extension. It says:

3 warnings and 16 errors generated.
make: *** [yaml.lo] Error 1
ERROR: `make' failed

And when I try to use yaml_parse_file() in my program, it says:

Fatal error: Call to undefined function yaml_parse_file()

How do I properly install the PECL yaml extension so I can use the PHP functions for parsing YAML?

  • 写回答

1条回答 默认 最新

  • doushao6874 2018-05-15 12:40
    关注

    I had similar issue and below steps helped me.

    First be sure you have installed yaml extension (as I know since brew will not help us for packages so better to use pecl)

    Even though some errors (such as failed for mkdir) occurred during installation it was completed.

    pecl install yaml
    

    Next open your php.ini file and add this line according to your path to yaml.so file.

    extension=/usr/local/Cellar/php70-yaml/2.0.0/yaml.so
    

    Hope it helps..

    评论

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用