lnmp搭建(三)PHP安装及配置
来源:互联网 发布:a类网络ip地址 编辑:程序博客网 时间:2024/06/06 10:12
lnmp架构之php安装及配置
一、安装
1、安装包 php-5.6.20.tar.bz2 解压:
tar jxf php-5.6.20.tar.bz2
2、编译:
./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-mysql --with-mysqli --with-pdo-mysql --enable-mysqld --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 --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
编译中的报错及解决:<每次解决报错后重新编译> <1> configure: error: xml2-config not found. Please check your libxml2 installation 解决:yum install libxml2-devel -y <2> configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/ 解决:yum install libcurl-devel -y <3> checking whether to enable truetype string function in GD... no checking whether to enable JIS-mapped Japanese font support in GD... no If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found. 解决:由于gd-devel由yum search找不到,所以需要从第三方下载 <4> configure: error: Unable to locate gmp.h 解决:yum install gmp-devel -y <5> configure: error: mcrypt.h not found. Please reinstall libmcrypt 解决:同样需要第三方下载,libmcrypt和libmcrypt-devel都需要下载 <6> configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation 解决:yum install net-snmp-devel -y
3、生成配置文件:make
4、安装:make install
**
二、配置
**
[root@server1 php-5.6.20]# cp php.ini-production /usr/local/lnmp/php/etc/php.ini
[root@server1 etc]# cd /usr/local/lnmp/php/etc/
[root@server1 etc]# vim php.ini
–> 1001 pdo_mysql.default_socket=/usr/local/lnmp/mysql/data/mysql.sock
1150 mysql.default_socket = /usr/local/lnmp/mysql/data/mysql.sock
1209 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock
[root@server1 etc]# vim php-fpm.conf
–> 24 ; Default Value: none
25 pid = run/php-fpm.pid ##前面的注释去掉
[root@server1 ~]# cd php-5.6.20/sapi/fpm
[root@server1 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@server1 fpm]# chmod +x /etc/init.d/php-fpm
/etc/init.d/php-fpm start
此时可以开启成功,成功后如下图:
测试:
[root@server1 conf]# vim /usr/local/lnmp/nginx/conf/nginx.conf 73 location ~ \.php$ { 74 root html; 75 fastcgi_pass 127.0.0.1:9000; 76 fastcgi_index index.php; 77 fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 78 include fastcgi.conf; 79 } 51 location / { 52 root html; 53 index index.php index.html index.htm; 54 }
[root@server1 html]# vim /usr/local/lnmp/nginx/html/index.php--> 1 <?php 2 phpinfo() 3 ?>
测试结果如图:
- lnmp搭建(三)PHP安装及配置
- lnmp搭建(二)MySQL安装及配置
- LNMP 安装及配置
- LNMP环境搭建之三--PHP
- 安装lnmp和wordpress – 搭建个人网站(三)
- centos7搭建lnmp安装二进制mysql【三】
- LNMP框架的搭建(nginx的安装与配置)
- 搭建PHP开发环境(三)-MySQL安装配置
- centos7搭建lnmp编译安装php【一】
- LNMP平台搭建---PHP安装篇
- centos6.7搭建lnmp及配置
- LNMP环境的搭建及基本配置
- Rhel7.2-Lnmp服务搭建及配置
- CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)
- CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)
- CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)
- CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)
- lnmp环境搭建,及memcached安装
- uCOS-ii 如何获取最高优先级的Task
- 413. Arithmetic Slices Add to List
- oracle创建数据库和删除数据库
- 100亿数据找出最大的1000个数字
- h.264/AVC的结构 NAL结构
- lnmp搭建(三)PHP安装及配置
- [HEOI2015]兔子与樱花
- 最短路问题
- linux 手动设置ip ..
- Android自定义控件--ProgressButton
- 全球勒索病毒爆发撞上比特币 ETF 重审,是巧合还是阴谋?
- C中结构体是否能用=运算符直接赋值的问题
- android 背景透明度改变
- java容器(四)-List接口(ArrayList,LinkedList)