升级Mac内置PHP

根据这个文章,敲以下命令即可。

curl -s http://plamenatv.free.bg/up.html | bash -s 7.0

安装完之后,php可执行文件会在/usr/local/php5/bin/php里面,把这个地址添加到PATH变量中,就可以在命令行使用php7了。

我在装完php7,使用pecl安装包时,系统提示“Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user”。
通过pecl config-get php_dir命令找到该文件夹,再用sudo chown -R <username> <php_dir>给予相应权限即可。

标签:none

添加新评论