簡體   English   中英

致命錯誤:ext/standard/php_smart_str.h:安裝 yaml 1.3.2 時沒有這樣的文件或目錄

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

我嘗試在我的設備中安裝 Yaml 1.3.2,它有 5.6 enable 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 版本並保留一個需要的版本后解決(PHP 5.6)

所以,我認為要解決問題,您需要啟用特定的 php 版本,並禁用其他版本,通常一切都會正常工作...

此外,您還需要確保如果為 php 7+ 安裝 yaml(v2.0+),則需要將其刪除,然后安裝支持 php 5 的 yaml-1.3.1。

注意:確保您安裝了 phpX.Y-xml。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM