PHP7中的PECL yaml

前端之家收集整理的这篇文章主要介绍了PHP7中的PECL yaml前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
PHP7中遇到pecl yaml的一些问题(参见下面的错误日志).我可以看到: https://pecl.php.net/package/yaml是有一些RC的2.0用于解决这个问题…我正在运行命令:
pecl install yaml && echo "extension=yaml.so" > /usr/local/etc/PHP/conf.d/ext-yaml.ini.

但是猜想这不会安装RC版本.如何安装RC?是否有供应的参数..?

我可以谷歌下面的解决方案(未测试):

pear config-set preferred_state beta

但我想这将为所有扩展设置一个全球beta状态.我只想安装此扩展程序作为测试版..

错误日志

running: make
/bin/bash /tmp/pear/temp/pear-build-defaultuserPVGidl/yaml-1.2.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/yaml -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserPVGidl/yaml-1.2.0/include -I/tmp/pear/temp/pear-build-defaultuserPVGidl/yaml-1.2.0/main -I/tmp/pear/temp/yaml -I/usr/local/include/PHP -I/usr/local/include/PHP/main -I/usr/local/include/PHP/TSRM -I/usr/local/include/PHP/Zend -I/usr/local/include/PHP/ext -I/usr/local/include/PHP/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-defaultuserPVGidl/yaml-1.2.0/include -I/tmp/pear/temp/pear-build-defaultuserPVGidl/yaml-1.2.0/main -I/tmp/pear/temp/yaml -I/usr/local/include/PHP -I/usr/local/include/PHP/main -I/usr/local/include/PHP/TSRM -I/usr/local/include/PHP/Zend -I/usr/local/include/PHP/ext -I/usr/local/include/PHP/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:40: fatal error: ext/standard/PHP_smart_str.h: No such file or directory
 #include <ext/standard/PHP_smart_str.h>
                                        ^
compilation terminated.
Makefile:195: recipe for target 'yaml.lo' Failed
make: *** [yaml.lo] Error 1
ERROR: `make' Failed
所以经过一些额外的谷歌搜索,我发现如何通过搜索如何安装测试版软件包来安装,而不是像我第一次寻找的那样安装.

http://php.net/manual/en/install.pecl.pear.php

..所以正确的命令是:

pecl install yaml-beta && echo "extension=yaml.so" > /usr/local/etc/PHP/conf.d/ext-yaml.ini

稳定版2.0.0于2016-09-24发布.仍支持版本1.x.x,因此您需要指定版本号,例如:

pecl install yaml-2.0.0 && echo "extension=yaml.so" > /usr/local/etc/PHP/conf.d/ext-yaml.ini

https://pecl.php.net/package/yaml查找最新版本

原文链接:https://www.f2er.com/php/138863.html

猜你在找的PHP相关文章