php安装dir,PHP安装:

PHP安装:

系统环境: RHEL5.4 x86-64

tar jxflibmcrypt-2.5.8.tar.bz2    ##解压安装包

./configure–prefix=/usr/local/php–with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql/

--with-openssl--with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir--with-jpeg-dir --with-

freetype-dir–with-pear --with-gettext --with-gmp --with-mcrypt--enable-inline-optimization --enable-soap

--enable-ftp--enable-sockets --enable-mbstring--with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm

--with-fpm-user=www–with-fpm-group=www–with-libdir=lib64

cgi.fix_pathinfo=0#防止Nginx文件类型错误解析漏洞

注: ln -s /usr/local/mysql/lib/usr/local/mysql/lib64不然php编译的时候找不到mysql的库文件

b15de29900684dc255cd9bd005d18754.png

845a122b982121e407e34b6d27ad5577.png

85ad4f6d7f74a752d4e5a84a1ae3a270.png

操作步骤

(1)安装

241  tarjxf php-5.6.20.tar.bz2

242  ls

243  cdphp-5.6.20/

244  ls

74453889fd26505634329a787d3ce142.png

245  cd..

246  yum install  curl-devellibjpeg-turbo-devel-1.2.1-1.el6.x86_64 libpng-devel  freetype-devel  net-snmp-devel bison  gmp-devel

248  ls

259 rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpmlibmcrypt-2.5.8-9.el6.x86_64.rpm ###解决依赖性的软件。

250  ls

251 rpm -ivh re2c-0.13.5-1.el6.x86_64.rpm  ###以上都是加载过程中需要的安装包。Yum库中没有就去网上下载

252  cdphp-5.6.20/

253 ./configure --prefix=/usr/local/lnmp/php--with-config-file-path=/usr/local/lnmp/php/etc --with-mysql=mysqlnd--with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-snmp--with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir--with-jpeg-dir --with-freetype-dir --with-gmp --with-gettext--enable-inline-optimization --enable-soap --enable-ftp --enable-sockets--enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx--with-mcrypt --with-mhash

254 make && make install

1db76cc61464ec54927d3a71cc49d3dc.png

在加载过程中缺什么安装什么。

0a3689b6e53a9087b282efa2264033fb.png

4b195af3b2cb2e1fca71a7764b5a680d.png

853b0bbf5e6c691b8dd70b6884e4305c.png

(2)配置

257  cp php.ini-production /usr/local/lnmp/php/etc/php.ini

258  cd sapi/

259  ls

260  cdfpm/

261  ls

262  cp init.d.php-fpm /etc/init.d/php-fpm

263 chmod +x /etc/init.d/php-fpm

264  cd ..

265  cd/usr/local/lnmp/php/etc/

f157594a176531f14b98b0e307dda328.png

266  ls

267 vim php.ini  ###改时区

925 date.timezone = Asia/shanghai

截图

d3f3b898688ab066fafb1606a0251fd3.png

268  cpphp-fpm.conf.default php-fpm.conf

269 vim php-fpm.conf

截图

21906cdebead68a66284b22ff05fed97.png

270 /etc/init.d/php-fpm start

9d74814039da144b81be774aa3f3bae2.png

276 vim  ~/.bash_profile

截图:

64030c937443668d62b2d079b4eefa43.png

277 source  ~/.bash_profile

278 php -m

279 netstat -antlp | grep :9000

281  cd..

282  cdnginx/

283  ls

284  cdconf

285  ls

286 vim nginx.conf

截图:

d57d6810c2b05602d6b2007efe1455c6.png

e46e699bfa50dd1c29a626fef0783d92.png

dc8f004bce6b4304985f94d90d792a47.png

287  cd..

288  cdhtml/

289  ls

291 vim index.php  ##完整路径vim /usr/local/lnmp/nginx/conf/nginx.conf

截图:

6c085ef20cf72580367bf7b7bcfb9d75.png

296 nginx -t    #检查nginx有没有语法错误

297 nginx   ###开启服务

测试:输入IP

30b75ad15697f7b94e35976df366d483.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值