在官网下载源码包:https://www.php.net/downloads.php
步骤:
1、解压
敕令:tar -xjvf php.tar.bz2
2、configure
configure东西是一个shell剧本,在设置编译前须要gcc、autoconfig东西。
相干引荐:《php教程》
能够经由过程./configure --help 检察设置参数
进入解压后的php目次,编译源码:
./configure --prefix=/home/php (--prefix指定装置php途径)
3、make
实行编译构建敕令:make
4、make install
实行编译构建敕令:make install
须要注重:实行敕令:php -i | grep php.ini 检察php实行的php.ini途径,复制设置文件php.ini文件到该目次,不然加载设置文件失利
PHP敕令:
php -m 检察php扩大
php -v 检察版本
php --ini 检察php.ini途径
php --ri swoole 检察swoole扩大是不是胜利
mac pro 设置php环境变量
vim ~/.bash_profile
到场:alias php=/home/php/bin/php 保留
source ~/.bash_profile
以上就是php源码怎样装置的细致内容,更多请关注ki4网别的相干文章!