标签:lamp-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_path info=0 #防止 Nginx 文件类型错误解析漏洞
注: ln -s /usr/local/mysql/lib/usr/local/mysql/lib64 不然 php 编译的时候找不到mysql 的库文件
操作步骤
(1)安装
241 tarjxf php-5.6.20.tar.bz2
242 ls
243 cdphp-5.6.20/
244 ls
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
在加载过程中缺什么安装什么。
(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/
266 ls
267 vim php.ini ###改时区
925 date.timezone = Asia/shanghai
截图
268 cpphp-fpm.conf.default php-fpm.conf
269 vim php-fpm.conf
截图
270 /etc/init.d/php-fpm start
276 vim ~/.bash_profile
截图:
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
截图:
287 cd..
288 cdhtml/
289 ls
291 vim index.php ## 完整路径vim /usr/local/lnmp/nginx/conf/nginx.conf
截图:
296 nginx -t #检查nginx有没有语法错误
297 nginx ###开启服务
测试:输入IP
标签:lamp-php
原文地址:http://12778805.blog.51cto.com/12768805/1952010