(四)企业部分之lnmp环境的搭建:PHP
PHP(外文名:PHP: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,利于学习,使用广泛,主要适用于Web开发领域。
PHP 独特的语法混合了C、Java、Perl以及PHP自创的语法。它可以比CGI或者Perl更快速地执行动态网页。用PHP做出的动态页面与其他的编程语言相比,PHP是将程序嵌入到HTML(标准通用标记语言下的一个应用)文档中去执行,执行效率比完全生成HTML标记的CGI要高许多;PHP还可以执行编译后代码,编译可以达到加密和优化代码运行,使代码运行更快。
1.PHP安装
软件包:php-5.6.19.tar.bz2re2c-0.13.5-1.el6.x86_64.rpmgd-devel-2.0.35-11.el6.x86_64.rpm
tarjxfphp-5.6.19.tar.bz2
yuminstallcurl-develre2c-0.13.5-1.el6.x86_64.rpmgd-devel-2.0.35-11.el6.x86_64.rpmgmp-develnet-snmp-devellibxml2-devel-y
cdphp-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
##详解##
[root@server1php-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
make&&makeinstall
2.php配置
cdphp-5.6.19cpphp.ini-production/usr/local/lnmp/php/etc/php.inivim/root/.bash_profile
source/root/.bash_profile
cd/usr/local/lnmp/php/etc/etc/init.d/mysqldstartcpphp-fpm.conf.defaultphp-fpm.conf
vimphp.ini
922date.timezone=Asia/Shanghai
1001pdo_mysql.default_socket=/usr/local/lnmp/mysql/data/mysql.sock
1150mysql.default_socket=/usr/local/lnmp/mysql/data/mysql.sock
1209mysqli.default_socket=/usr/local/lnmp/mysql/data/mysql.sock
chmod755/usr/local/lnmp/mysql/data/
vimphp-fpm.conf
25pid=run/php-fpm.pid
cdphp-5.6.19/sapi/fpm/cpinit.d.php-fpm/etc/init.d/fpmchmod+x/etc/init.d/fpm/etc/init.d/fpmstartphp-m##查看php支持插件psaux|grepnginx
vim/usr/local/lnmp/nginx/html/index.ph
<?php
phpinfo();
?>
vim/usr/local/lnmp/nginx/conf/nginx.conf
添上index.php
将76-82location~\.php$注释去掉,将include后面修改成存在的名称
nginx-tnginx-sreload
3.搭建论坛
unzipDiscuz_X3.2_SC_UTF8.zip-d/usr/local/lnmp/nginx/html/
cd/usr/local/lnmp/nginx/html/mvupload/bbschmod777bbs/config/-Rchmod777bbs/data/-Rchmod777bbs/uc_*-R
登陆mysql:
mysql-p
mysql> CREATEDATABASEdiscuz;
mysql> grantallondiscuz.*towjl@localhostidentifiedby"Westos+007";
访问网页ip/bbs
进行安装
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。