linux 源码安装php5.6
2015-12-12 15:48
579 查看
系统centos
下载
>wget http://hk1.php.net/get/php-5.6.15.tar.gz/from/this/mirror
>tar -xzf php-5.6.15.tar.gz
安装依赖
>yum -y install libxml2 libxml2-devel
>yum -y install curl curl-devel
>yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
>yum -y install zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel
>yum -y install libmcrypt libmcrypt-devel mcrypt mhash
这一步如果遇到No package xxx available.a
更新下yum即可
>yum
install epel-release //扩展包更新包
>yum update
>yum clean all
安装mysql 略(详见另一篇文章
linux源码安装mysql)
编译安装开始
>./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-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock
--with-gd --with-png-dir --with-jpeg-dir --with-freetype-dir --with-zlib-dir --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring
--enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype
>make
>make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary: /usr/local/php/bin/
Installing PHP CLI man page: /usr/local/php/php/man/man1/
Installing PHP FPM binary: /usr/local/php/sbin/
Installing PHP FPM config: /usr/local/php/etc/
Installing PHP FPM man page: /usr/local/php/php/man/man8/
Installing PHP FPM status page: /usr/local/php/php/php/fpm/
Installing PHP CGI binary: /usr/local/php/bin/
Installing PHP CGI man page: /usr/local/php/php/man/man1/
Installing build environment: /usr/local/php/lib/php/build/
Installing header files: /usr/local/php/include/php/
Installing helper programs: /usr/local/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/php/man/man1/
page: phpize.1
page: php-config.1
/root/php-5.6.15/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar
Installing PDO headers: /usr/local/php/include/php/ext/pdo/
复制配置文件
>cp php.ini-production /usr/local/php/etc/php.ini
>cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
>cp sapi/fpm/php-fpm.conf /usr/local/php/etc/php-fpm.conf
修改启动用户(新建用户,组)
>vi /usr/local/php/etc/php-fpm.conf
约149行
user = 用户名
group = 组名
配置开机启动
>chmod 755 /etc/init.d/php-fpm
>chkconfig --add php-fpm
>chkconfig --level 345 php-fpm on
启动
>/etc/init.d/php-fpm start
Starting php-fpm done
>/etc/init.d/php-fpm --help查看更多
Usage: ./php-fpm {start|stop|force-quit|restart|reload|status}
下载
>wget http://hk1.php.net/get/php-5.6.15.tar.gz/from/this/mirror
>tar -xzf php-5.6.15.tar.gz
安装依赖
>yum -y install libxml2 libxml2-devel
>yum -y install curl curl-devel
>yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
>yum -y install zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel
>yum -y install libmcrypt libmcrypt-devel mcrypt mhash
这一步如果遇到No package xxx available.a
更新下yum即可
>yum
install epel-release //扩展包更新包
>yum update
>yum clean all
安装mysql 略(详见另一篇文章
linux源码安装mysql)
编译安装开始
>./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-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock
--with-gd --with-png-dir --with-jpeg-dir --with-freetype-dir --with-zlib-dir --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring
--enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype
>make
>make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary: /usr/local/php/bin/
Installing PHP CLI man page: /usr/local/php/php/man/man1/
Installing PHP FPM binary: /usr/local/php/sbin/
Installing PHP FPM config: /usr/local/php/etc/
Installing PHP FPM man page: /usr/local/php/php/man/man8/
Installing PHP FPM status page: /usr/local/php/php/php/fpm/
Installing PHP CGI binary: /usr/local/php/bin/
Installing PHP CGI man page: /usr/local/php/php/man/man1/
Installing build environment: /usr/local/php/lib/php/build/
Installing header files: /usr/local/php/include/php/
Installing helper programs: /usr/local/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/php/man/man1/
page: phpize.1
page: php-config.1
/root/php-5.6.15/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar
Installing PDO headers: /usr/local/php/include/php/ext/pdo/
复制配置文件
>cp php.ini-production /usr/local/php/etc/php.ini
>cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
>cp sapi/fpm/php-fpm.conf /usr/local/php/etc/php-fpm.conf
修改启动用户(新建用户,组)
>vi /usr/local/php/etc/php-fpm.conf
约149行
user = 用户名
group = 组名
配置开机启动
>chmod 755 /etc/init.d/php-fpm
>chkconfig --add php-fpm
>chkconfig --level 345 php-fpm on
启动
>/etc/init.d/php-fpm start
Starting php-fpm done
>/etc/init.d/php-fpm --help查看更多
Usage: ./php-fpm {start|stop|force-quit|restart|reload|status}
相关文章推荐
- 20151208linux系统日常管理第三部分(linux下使用iptables实现内网的ftp端口映射 )扩展3
- linux文件与文件系统的压缩与打包
- Linux下如何捕获错误
- centos7 时间修改
- 2015-12-12linux系统日常管理第五部分( rsync )
- Linux驱动子系统之I2C
- Linux 每日一练 :设置别名,给喜欢的人起外号!!!!
- 【Linux驱动】轮询操作select()和poll()
- APUE-3源码环境搭建 CentOS
- GUN/LINUX命令之 cp mv install
- 嵌入式 Linux开发 之 tftp
- Linux平台swift语言开发学习环境搭建
- 配置Windows,Linux双网卡互联并同时能上外网
- 在linux下解决adb devices:???????? no permission
- CentOS7 配置接口IP
- Mysql5.7在linux上安装步骤
- linux文件系统
- linux文件系统
- 20151211linux系统日常管理第五部分(scp )
- linux 下svn安装配置