码迷,mamicode.com
首页 > Web开发 > 详细

php安装

时间:2018-01-23 21:17:20      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:rod   shmop   system   wrap   etc   free   目录   epo   rap   

#!/bin/sh

####安装curl-7.44.0.tar.gz
cd /usr/local/src/
tar -zxvf curl-7.44.0.tar.gz
cd  curl-7.44.0
./configure --prefix=/usr/local/curl --enable-shared
make test #or make test  #测试编译
make install #开始编译安装
yum install curl-devel

####安装redis-2.8.3.tar.gz
cd /usr/local/src/
tar -zxvf redis-2.8.3.tar.gz
cd  redis-2.8.3
make #or make test  #测试编译
make install #开始编译安装

mkdir -p /usr/local/redis
cp /usr/local/src/redis-2.8.3/src/redis-server /usr/local/redis/
cp /usr/local/src/redis-2.8.3/src/redis-cli /usr/local/redis/
cp /usr/local/src/redis-2.8.3/src/redis-benchmark /usr/local/redis/
cp /usr/local/src/redis-2.8.3/redis.conf /usr/local/redis/
####修改redis.conf  daemonize no改成yes 是否后台运行 #maxmemory改成 maxmemory 256 mb  

####安装php-5.6.11.tar.bz2
cd /usr/local/src/
tar -zxvf php-5.6.11.tar.bz2
cd  php-5.6.11
yum install libpng* -y
yum install libxml2* -y
yum install mhash* -y
yum install libxslt* -y
yum install libjpeg* -y
yum install freetype* -y
yum install zlib-devel -y
yum install glibc* -y
yum install bzip2* -y
yum install ncurses-devel -y
yum install curl-devel -y
yum install e2fsprogs -y
yum install krb5 -y
yum install libidn -y
yum install openssl -y
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo http://mirrors.aliyun.com/repo/Centos-6.repo ##切换yum源
yum repolist
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --enable-xml=/usr/local/libxml2 --with-gd --with-iconv --with-zlib --with-curl --with-mcrypt --enable-session --with-gettext  --without-pear --with-openssl --enable-ftp --enable-sockets --enable-zip --enable-soap --with-xmlrpc --enable-bcmath --enable-shmop --enable-system --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-inline-optimization --with-curlwrappers
make test #or make test  #测试编译
make install #开始编译安装
mkdir -p /usr/local/php/etc
cp /usr/local/src/php-5.6.11/php.ini-production /usr/local/php/etc/php.ini
rm -rf /etc/php.ini
ln -s /usr/local/php/etc/php.ini /etc/php.ini #创建软连接
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
#修改php-fpm.conf 把user=nobody 改成www 把group=nobody 改成www  找到pid=run/php-fpm.pid 打开  
###修改php.ini文件date.timezone=PRC disable_functions=phpinfo

####设置开机启动
cd /usr/local/src/php-5.6.11/sapi
cd fpm
cp init.d.php-fpm /etc/rc.d/init.d/php-fpm
cd /etc/rc.d/init.d
chmod +x php-fpm
chkconfig php-fpm on

#修改nginx.conf文件 index.php  9000端口 /scripts改成$document_root

#修改目录权限
cd /usr/local/nginx
chown -R www html
chmod -R 777 html

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf #启动Nginx
/usr/local/nginx/sbin/nginx -s reload #重启Nginx
service php-fpm start

  

php安装

标签:rod   shmop   system   wrap   etc   free   目录   epo   rap   

原文地址:https://www.cnblogs.com/gan-wenjun/p/8337838.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!