【发布时间】:2017-01-28 06:13:02
【问题描述】:
好的,所以我正在使用 vagrant 安装 php 和 php-fpm 的食谱
见https://supermarket.chef.io/cookbooks/php 和 https://supermarket.chef.io/cookbooks/php-fpm
这是我的 Vagrantfile 的一部分
chef.add_recipe "php::source"
chef.add_recipe "php-fpm"
chef.add_recipe "nginx"
:php => {
:version => "5.6.13"
},
还有
config.vm.box = "hashicorp/precise64"
这是 nginx 配置的一部分
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php-fpm-www.sock;
fastcgi_index index.php;
}
但是当我访问包含 phpinfo() 函数的 phpinfo.php 时,它会输出 PHP Version 5.3.10-1ubuntu3.25
而当我执行 php -v 时,它会输出 PHP 5.6.13
我想使用 PHP 5.6.13 ....我如何配置 vagrant 以便它使用 PHP 5.6.13 来执行 Web 服务器提供的实际 php 脚本?
【问题讨论】:
-
查看你使用的cookbook,php-fpm默认安装包版本,见github.com/yevgenko/cookbook-php-fpm/blob/master/recipes/…
标签: php nginx vagrant chef-infra vagrantfile