标签:root权限 def jpeg mys pcre add sock run cmak
php-5.4.15 centos安装手册
1、权限
请以root权限登陆
如果非root权限登陆,请运行sudo su - 命令切换到root权限
2、准备好编译环境(如果安装了可以省略)
yum -y install wget gcc gcc-c++ ncurses-devel cmake make perl
yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel
3、准备好centos所需要的用户组(如果创建了可以省略)
3.1、新增用户组
groupadd www
3.2、新增用户
useradd www -g www
4、准备好源代码安装目录(如果创建了可以省略)
mkdir -p /root/src
cd /root/src
5、下载、编译libmcrypt
5.1、下载libmcrypt源代码压缩包
wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
5.2、解压源代码
tar -vxzf libmcrypt-2.5.8.tar.gz
5.3、进入源代码目录
cd libmcrypt-2.5.8
5.4、通过configure生成Makefile
./configure
5.5、编译libmcrypt
make
5.5、安装libmcrypt
make install
6、下载、编译php
6.1、下载php源代码压缩包
wget http://cn2.php.net/distributions/php-5.4.15.tar.gz
6.2、解压源代码
tar -vxzf php-5.4.15.tar.gz
6.3、进入源代码目录
cd php-5.4.15
6.4、通过configure生成Makefile
./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt --with-zlib
--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath
--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex
--with-mhash --enable-zip --with-pcre-regex --with-mysql
prefix是指安装目录,一般安装在/usr/local/php
6.5、编译php
make
6.5、安装php
make install
7、复制配置文件php-fpm和php.ini
7.1、复制php-fpm
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
7.2、复制php.ini
产品
cp php.ini-production /usr/local/php/lib/php.ini
开发
cp php.ini-development /usr/local/php/lib/php.ini
gd库
cd /ext/gd
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-png-dir --with-freetype-dir --with-jpeg-dir --with-zlib-dir --with-gd
8、配置php-fpm.conf
pid=/usr/local/php/var/run/php-fpm.pid
user = www
group = www
pm = static
pm.max_children = 64
==================================
mynote:以上修改内容在php-fpm.conf文件中找到对应的地方一一修改
9、启动暂停php-fpm
9.1、启动php-fpm
/usr/local/php/sbin/php-fpm
确认
ps -elf | grep php | wc -l
根据刚才的php-fpm.conf应该输出是66
9.2、暂停php-fpm
kill -INT cat /usr/local/php/var/run/php-fpm.pid
9.3、php-fpm 重启:
kill -USR2 cat /usr/local/php/var/run/php-fpm.pid
标签:root权限 def jpeg mys pcre add sock run cmak
原文地址:https://www.cnblogs.com/zhirusi/p/10129036.html