您的位置:首页 > 编程语言 > PHP开发

php编译安装

2016-06-08 16:28 417 查看
1.wget http://cn2.php.net/distributions/php-5.4.37.tar.bz2
2.tar jxf php-5.4.37.tar.bz2
3.useradd -s /sbin/nologin php-fpm
4.cd php-5.4.37
5. ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-curl

make && make install

6.cp php.ini-production /usr/local/php/etc/php.ini

7.拷贝启动脚本:
cd /usr/local/src/php-5.4.37/
8.cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
9.mv /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
10.chmod 755 /etc/init.d/php-fpm
11.chkconfig --add php-fpm
12.service php-fpm start
13.chkconfig php-fpm on

/usr/local/php/sbin/php-fpm -t 检查配置是否正确

checking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.Fix:
复制代码 代码如下:
yum -y install libjpeg-devel

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
复制代码 代码如下:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make && make install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: