centos7安裝php環境,brew 安裝php7.1.6_mac上通過brew安裝php7

 2023-11-10 阅读 20 评论 0

摘要:mac上通過brew安裝php7php在mac上安裝軟件很爽,用brew就搞定了。現在紀錄下,用brew安裝php7。centos7安裝php環境,設置brewbrew tap homebrew/dupesbrew tap homebrew/versionsbrew tap homebrew/homebrew-phpmac上安裝homebrew?安裝php7brew install php70報

mac上通過brew安裝php7

php

在mac上安裝軟件很爽,用brew就搞定了。現在紀錄下,用brew安裝php7。

centos7安裝php環境,設置brew

brew tap homebrew/dupes

brew tap homebrew/versions

brew tap homebrew/homebrew-php

mac上安裝homebrew?安裝php7

brew install php70

報錯了?

configure的時候,報錯了:checking for ZLIB support... yes

php7.4安裝、checking if the location of ZLIB install directory is defined... no

configure: error: Cannot find libz

但是,我查看 libz 其實是有安裝的。brew search zlib

homebrew/dupes/zlib ? lzlib

mac安裝homebrew?通過google 和查看 Cannot find libz 發現需要安裝 xcode-select

安裝 xcode-select

xcode-select--install

會彈框出來。點擊安裝就可以了:

centos7安裝php,安裝好了之后。繼續brew install php70

一段時間之后,安裝成功了。

配置文件目錄

php.ini/usr/local/etc/php/7.0/php.ini

brew安裝、php-fpm.conf/usr/local/etc/php/7.0/php-fpm.conf

php, phpize, php-conigls /usr/local/opt/php70/bin

phar php php-cgi php-config phpize

php-fpm/usr/local/opt/php70/sbin/php-fpm

mac安裝應用?測試

php版本

?/usr/local/opt/php70/bin/php-v

PHP7.0.4(cli)(built:Mar15201615:40:41)(NTS)

mac安裝php、Copyright(c)1997-2016ThePHPGroup

ZendEnginev3.0.0,Copyright(c)1998-2016ZendTechnologies

withZendOPcachev7.0.6-dev,Copyright(c)1999-2016,byZendTechnologies

withXdebugv2.4.0,Copyright(c)2002-2016,byDerickRethans

mac安裝命令、php-fpm版本

PHP7.0.4(fpm-fcgi)(built:Mar15201615:40:46)

Copyright(c)1997-2016ThePHPGroup

ZendEnginev3.0.0,Copyright(c)1998-2016ZendTechnologies

withZendOPcachev7.0.6-dev,Copyright(c)1999-2016,byZendTechnologies

withXdebugv2.4.0,Copyright(c)2002-2016,byDerickRethans

啟動php-fpm

//刪掉老的

sudo pkill php-fpm

//啟動新的

sbin git:(master)/usr/local/opt/php70/sbin/php-fpm

[15-Mar-201616:58:06]NOTICE:[pool www]'user'directiveisignoredwhenFPMisnotrunningasroot

[15-Mar-201616:58:06]NOTICE:[pool www]'group'directiveisignoredwhenFPMisnotrunningasroot

[15-Mar-201616:58:06]NOTICE:fpmisrunning,pid43008

[15-Mar-201616:58:06]NOTICE:ready to handle connections

打開 index.php 里的 phpinfo()看是否是php7.0.4版本了。

安裝擴展

redis

brew install php70-redis

配置文件:

/usr/local/etc/php/7.0/conf.d/ext-redis.ini

memcached

brew install php70-memcached

配置文件:

/usr/local/etc/php/7.0/conf.d/ext-memcached.ini

swoole

brew install php70-swoole

配置文件:

/usr/local/etc/php/7.0/conf.d/ext-swoole.ini

其他擴展類似這樣安裝。

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/169908.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息