linux php5.5安装配置的方法:首先下载PHP源码包;然后添加epel源,创建www用户;接着进行编译安装“/usr/local/src/php-5.5.15/”;最后配置PHP即可。
推荐:《PHP视频教程》
php5.5编译安装
系统环境:centos6.5
PHP包:5.5.15
https://wiki.swoole.com/wiki/page/177.html
下载 PHP 源码包
wget http://cn2.php.net/distributions/php-5.5.15.tar.bz2
tar xf php-5.5.15.tar.bz2 -C /usr/local/src/
配置文件: /usr/local/php/etc/php-fpm.conf
配置pid: /var/run/php-fpm/php-fpm.pid
错误日志:error_log=/var/log/php-fpm.log
/etc/php.ini
添加 epel 源
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel
创建 www 用户
groupadd www useradd -g www -s /sbin/nologin -M www
编译安装
cd /usr/local/src/php-5.5.15/ ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=/usr/local/mysql --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear
你的 Web Server
使用的 Apache 请添加类似:
--with-apxs2=/usr/local/apache/bin/apxs 参数 --prefix=/usr/local/php 安装路径 --with-config-file-path=/etc php.ini配置文件路径 --enable-inline-optimization 优化项 --disable-debug --disable-rpath --enable-shared --enable-opcache 启用 opcache,默认为 ZendOptimizer+(ZendOpcache) --enable-fpm FPM --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd MySQL --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext 国际化与字符编码支持 --enable-mbstring --with-iconv --with-mcrypt 加密扩展 --with-mhash --with-openssl --enable-bcmath 数学扩展 --enable-soap Web 服务,soap 依赖 libxml --with-libxml-dir --enable-pcntl 进程,信号及内存 --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets socket & curl --with-curl --with-zlib 压缩与归档 --enable-zip --with-bz2 --with-readline GNU Readline 命令行快捷键绑定 --without-sqlite3 --without-pdo-sqlite --with-pear