网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

(二)lnmp环境的搭建:php

php简介:PHP(外文名:PHP: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,利于学习,使用广泛,主要适用于Web开发领域。PHP 独特的语法混合了C、Java、Perl以及PHP自创的语法。它可以比CGI或者Perl更快速地执行动态网页。用PHP做出的动态页面与其他的编程语言相比,PHP是将程序嵌入到HTML(标准通用标记语言下的一个应用)文档中去执行,执行效率比完全生成HTML标记的CGI要高许多;PHP还可以执行编译后代码,编译可以达到加密和优化代码运行,使代码运行更快。

延寿网站建设公司创新互联,延寿网站设计制作,有大型网站制作公司丰富经验。已为延寿数千家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的延寿做网站的公司定做!

软件环境:redhat6.5

iptables off  and selinux disabled


php安装:

所需要的软件包:php-5.6.19.tar.bz2 re2c-0.13.5-1.el6.x86_64.rpm gd-devel-2.0.35-11.el6.x86_64.rpm

1
tar jxf php-5.6.19.tar.bz2 #解包
1

yum install curl-devel re2c-0.13.5-1.el6.x86_64.rpm gd-devel-2.0.35-11.el6.x86_64.rpm gmp-devel net-snmp-devel libxml2-devel -y #解决安装时的依赖性


1
2
cd php-5.6.19
./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 --without-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


make && make install

安装模块详解:

[root@server1 php-5.6.19]# ./configure --prefix=/usr/local/lnmp/php \

> --with-config-file-path=/usr/local/lnmp/php/etc \

> --with-mysql=mysqlnd \##自动加载mysql信息

> --with-mysqli=mysqlnd \

> --with-pdo-mysql=mysqlnd \

> --with-openssl \

> --with-snmp \##加载简单网管协议

> --with-gd \##支持图形

> --with-zlib \##支持网页压缩

> --with-curl \##支持文本浏览

> --with-libxml-dir \##支持xml

> --with-png-dir \##支持png图片

> --with-jpeg-dir \##支持jpeg

> --with-freetype-dir \

> --without-pear \##不联网安装

> --with-gettext \##

> --with-gmp \##支持gmp

> --enable-inline-optimization \

> --enable-soap \##支持动态加载模块

> --enable-ftp \##支持ftp

> --enable-sockets \##支持套结字

> --enable-mbstring \

> --enable-fpm \

> --with-fpm-user=nginx \##使php和nginx权限一致

> --with-fpm-group=nginx

php的配置:

 

1
2
3
cd php-5.6.19
cp php.ini-production /usr/local/lnmp/php/etc/php.ini
vim /root/.bash_profile

(二)lnmp环境的搭建:php


1
source /root/.bash_profile
1
2
3
cd /usr/local/lnmp/php/etc
/etc/init.d/mysqld start
cp php-fpm.conf.default php-fpm.conf

vim php.ini #更改时区

922 date.timezone = Asia/Shanghai

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

1
chmod 755 /usr/local/lnmp/mysql/data/
1
vim php-fpm.conf

25 pid = run/php-fpm.pid

 

1
2
3
4
5
6
cd php-5.6.19/sapi/fpm/
cp init.d.php-fpm /etc/init.d/fpm
chmod +x /etc/init.d/fpm
/etc/init.d/fpm start
php -m   #查看支持的插件

ps aux | grep nginx  #查看开启的端口号和进程

vim /usr/loacl/lnmp/nginx/html/index.ph #制作一个PHP测试页面

phpinfo();

?>

vim /usr/local/lnmp/nginx/conf/nginx.conf


将76-82 location ~ \.php$ 注释去掉,将include后面修改成存在的名称

(二)lnmp环境的搭建:php

(二)lnmp环境的搭建:php


nginx -t 

nginx -s reload

访问:

(二)lnmp环境的搭建:php




当前标题:(二)lnmp环境的搭建:php
转载来于:http://bjjierui.cn/article/jpocep.html

其他资讯