Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问扩展只能运行在CLI模式下吗? #21

Closed
wanganb opened this issue Dec 19, 2016 · 1 comment
Closed

请问扩展只能运行在CLI模式下吗? #21

wanganb opened this issue Dec 19, 2016 · 1 comment

Comments

@wanganb
Copy link

wanganb commented Dec 19, 2016

您好,我在测试时,发现在CLI模式下可以正常使用,但网页端请求脚本则无法获取正确结果(网页获取phpinfo可以正常显示yaconf扩展相关配置项,可以确定php.ini配置没什么大问题),请问在使用方式上有限制吗?还是需要进行其他的设置?

【我测试环境】
apache2.4 + php和yaconf扩展都是采用源码编译的方式(php版本为7.0.9,yaconf为github上clone的最新代码[2016.12.19])。

php7 编译:

./configure -prefix=/usr/local/php7 --with-apxs2=/usr/sbin/apxs --enable-fpm --enable-debug
make && make install

yaconf编译:

./configure --with-php-config=/usr/local/php7/bin/php-config
make && make install

php.ini配置文件:

[yaconf]
yaconf.directory=/tmp/yaconf

/tmp/yaconf目录下test.ini资源文件内容:

name="yaconf"
year=2016

php测试代码test.php:

var_dump(Yaconf::get('test'));

实验效果:

$php -f test.php
array(2) {
["name"]=>
string(4) "test"
["year"]=>
string(4) "2016"
}
通过网页访问test.php返回:
NULL

@wanganb wanganb changed the title 请问请问扩展只能运行在CLI模式下吗? 请问扩展只能运行在CLI模式下吗? Dec 19, 2016
@laruence
Copy link
Owner

laruence commented Jan 8, 2018

当然不是.....-_#

@laruence laruence closed this as completed Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants