一般情况下,我们在linux环境下推荐安装单个软件,然后进行连接
1.php的安装,从www.php.net 下载最新的php版本
解压 tar -xjvf php-7.3.4.tar.bz2 ,缺少什么会提示,然后进行安装
tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
yum install bzip2
解压到 /home/work/study/software,输入命令 ll ,发现php-7.3.4
cd php-7.3.4 ,
进行configure, ./configure --prefix=/home/work/study/soft/php 缺少libxml2
要安装libxml2和libxslt首先得安装EPEL源.
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install libxml2 libxslt
yum install libxml2-devel
安装成功后,重新configure
然后编译 make
make install
cd /home/work/study/soft/php
测试 vi test.php
./bin/php test.php
简化php 执行命令
vi ~/.bash_profile
添加
export PATH
alias php=/home/work/study/soft/php/bin/php
执行
source ~/.bash_profile
测试 php -v
设置php.ini
php -i | grep php.ini
查看php.ini应该放的目录
mv php.ini-development /home/work/study/soft/php/lib
mv php.ini-development php.ini