简体   繁体   中英

fatal error: ext/standard/php_smart_str.h: No such file or directory when install yaml 1.3.2

I try to install Yaml 1.3.2 in my device which is has 5.6 enable php version... After Execute this command sudo pecl install yaml-1.3.2 I got this error:

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**

Notes :

OS: 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

This issue resolved after removing all php versions and keep one version which is needed (PHP 5.6)

So that, I think to resolve issue you need to enable specific php ver, and disable others and usually all will work fine...

Also you need to make sure thats if you install yaml(v2.0+) for php 7+, you need to remove it and then install yaml-1.3.1 which its support php 5.

Note: make sure you are installe phpX.Y-xml.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM