企业部分之PHP(未完)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了企业部分之PHP(未完)相关的知识,希望对你有一定的参考价值。
1.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
tar jxf php-5.6.19.tar.bz2
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
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
####
[[email protected] 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
make && make install
2.php 配置
cd php-5.6.19
cp php.ini-production /usr/local/lnmp/php/etc/php.ini
vim /root/.bash_profile
图
source /root/.bash_profile
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
chmod 755 /usr/local/lnmp/mysql/data/
vim php-fpm.conf
25 pid = run/php-fpm.pid
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##查看php支持插件
ps aux | grep nginx
vim /usr/local/lnmp/nginx/html/index.php
<?php
phpinfo();
?>
vim /usr/local/lnmp/nginx/conf/nginx.conf
添上index.php
将76-82 location ~ \.php$ 注释去掉,将include后面修改成存在的名称
图
nginx -t
nginx -s reload
图
3.搭建论坛
unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/lnmp/nginx/html/
cd /usr/local/lnmp/nginx/html/
mv upload/ bbs
chmod 777 bbs/config/ -R
chmod 777 bbs/data/ -R
chmod 777 bbs/uc_* -R
登陆mysql:mysql -p
CREATE DATABASE discuz;
grant all on discuz.* to [email protected] identified by "Westos+007";
访问网页 ip/bbs
进行安装
图图图
以上是关于企业部分之PHP(未完)的主要内容,如果未能解决你的问题,请参考以下文章