We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务器上本来有多个版本的PHP,因为误操作把一个老版本的PHP给误删,只好重装。
因为好久没装过环境了,有些生疏,所以把编译安装过程简单记下来
因为历史原因,一些老的服务必须依赖 PHP-5.3.27 所以以此版本为例
tar -zxvf php-5.3.27.tar.gz
./configure --prefix=/usr/local/php-5.3.27 \ --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-iconv-dir=/usr/local \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-libxml-dir \ --enable-xml \ --enable-pdo \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --with-mcrypt \ --with-curlwrappers \ --enable-mbregex \ --enable-fpm \ --enable-mbstring \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --with-pear \ --with-bz2 \
make
make install
复制配置文件 php.ini
cp php.ini-development /usr/local/php-5.3.27/lib/php.ini
PS: 这个版本的 php.ini 文件要放在bin目录下,之前一直按照 php5.6 放在etc目录下,导致出现各种问题,看了 ./php -i | grep ini 后才发现
./php -i | grep ini
Configuration File (php.ini) Path => /usr/local/php-5.3.27/lib
配置 php-fpm 因为用了 nginx 做为服务器,所以用 php-fpm 做个 FastCGI 管理器
cp php-fpm.conf.default php-fpm.conf
pid = run/php-fpm.pid
php-fpm.conf user=www group=www
listen = 127.0.0.1:9527
cp /etc/init.d/php-fpm /etc/init.d/php-fpm5327
./php-fpm5327 start
是 memcached 不是 memcache
wget http://launchpad.net/libmemcached/1.0/0.42/+download/libmemcached-0.42.tar.gz
tar -zxvf libmemcached-0.42.tar.gz
cd libmemcached-0.42
./configure --prefix=/usr/local/libmemcached --with-memcached
make && make install
/usr/local/php-5.3.27/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.27/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
./configure --with-php-config=/usr/local/php-5.3.27/bin/php-config
./usr/local/php-5.3.27/bin/phpize
./configure -with-php-config=/usr/local/php-5.3.27/bin/php-config -with-pdo-mysql=/usr/local/mysql
根据需要安装完各种扩展后 重启 fpm 即可: /etc/init.d/php-fpm5327 restart
/etc/init.d/php-fpm5327 restart
The text was updated successfully, but these errors were encountered:
ccforward
No branches or pull requests
起因
服务器上本来有多个版本的PHP,因为误操作把一个老版本的PHP给误删,只好重装。
因为好久没装过环境了,有些生疏,所以把编译安装过程简单记下来
安装环境
因为历史原因,一些老的服务必须依赖 PHP-5.3.27 所以以此版本为例
编译PHP
tar -zxvf php-5.3.27.tar.gz
make
make install
复制配置文件 php.ini
PS: 这个版本的 php.ini 文件要放在bin目录下,之前一直按照 php5.6 放在etc目录下,导致出现各种问题,看了
./php -i | grep ini
后才发现配置 php-fpm
因为用了 nginx 做为服务器,所以用 php-fpm 做个 FastCGI 管理器
cp php-fpm.conf.default php-fpm.conf
pid = run/php-fpm.pid
php-fpm.conf user=www group=www
和listen = 127.0.0.1:9527
端口要根据 nginx 的 vhost 配置文件来做具体修改
复制之前的
cp /etc/init.d/php-fpm /etc/init.d/php-fpm5327
附一个脚本源码 php-fpm
启动 fpm
./php-fpm5327 start
安装 memcached 扩展
是 memcached 不是 memcache
安装libmemcached
wget http://launchpad.net/libmemcached/1.0/0.42/+download/libmemcached-0.42.tar.gz
tar -zxvf libmemcached-0.42.tar.gz
cd libmemcached-0.42
./configure --prefix=/usr/local/libmemcached --with-memcached
make && make install
安装 memcached 扩展
/usr/local/php-5.3.27/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.27/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
make && make install
安装 php mongo 扩展
/usr/local/php-5.3.27/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.27/bin/php-config
make && make install
安装 mysql_pdo
./usr/local/php-5.3.27/bin/phpize
./configure -with-php-config=/usr/local/php-5.3.27/bin/php-config -with-pdo-mysql=/usr/local/mysql
make && make install
根据需要安装完各种扩展后 重启 fpm 即可:
/etc/init.d/php-fpm5327 restart
The text was updated successfully, but these errors were encountered: