【问题标题】:fatal error: ext/standard/php_smart_str.h: No such file or directory when install yaml 1.3.2致命错误:ext/standard/php_smart_str.h:安装 yaml 1.3.2 时没有这样的文件或目录
【发布时间】:2020-01-12 09:41:43
【问题描述】:

我尝试在我的设备上安装 Yaml 1.3.2,它有 5.6 启用 php 版本... 执行此命令sudo pecl install yaml-1.3.2 后出现此错误:

creating libtool
    appending configuration tag "CXX" to libtool
    configure: patching config.h.in
    configure: creating ./config.status
    config.status: creating config.h
    running: make
    /bin/bash /tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/yaml -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/include -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/main -I/tmp/pear/temp/yaml -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/yaml/yaml.c -o yaml.lo
    mkdir .libs
    cc -I. -I/tmp/pear/temp/yaml -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/include -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/main -I/tmp/pear/temp/yaml -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/yaml/yaml.c  -fPIC -DPIC -o .libs/yaml.o
    In file included from /tmp/pear/temp/yaml/yaml.c:35:0:
    /tmp/pear/temp/yaml/php_yaml.h:56:10: fatal error: ext/standard/php_smart_str.h: No such file or directory
     #include <ext/standard/php_smart_str.h>
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    **compilation terminated.
    Makefile:193: recipe for target 'yaml.lo' failed
    make: *** [yaml.lo] Error 1
    ERROR: `make' failed**

注意事项

操作系统:Ubuntu 18

 php5.6 -i | grep yaml

/etc/php/5.6/cli/conf.d/20-yaml.ini,
yaml
yaml.decode_binary => 0 => 0
yaml.decode_php => 1 => 1
yaml.decode_timestamp => 0 => 0
yaml.output_canonical => 0 => 0
yaml.output_indent => 2 => 2
yaml.output_width => 80 => 80

【问题讨论】:

    标签: php yaml


    【解决方案1】:

    在删除所有 php 版本并保留一个需要的版本后解决此问题(PHP 5.6)

    因此,我认为要解决问题,您需要启用特定的 php 版本,并禁用其他版本,通常一切都会正常...

    此外,如果您为 php 7+ 安装 yaml(v2.0+),您还需要确保将其删除,然后安装支持 php 5 的 yaml-1.3.1。

    注意:请确保您安装的是 phpX.Y-xml。

    【讨论】:

      猜你喜欢
      • 2019-07-28
      • 2013-11-27
      • 1970-01-01
      • 1970-01-01
      • 2014-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多