Home | Mirror | Search

3. php-5.3.13 + MySQL-devel-5.5.25

wget http://tw.php.net/distributions/php-5.3.13.tar.gz
		

mysql开发库

ls -1

MySQL-devel-5.5.25-1.el6.x86_64.rpm
MySQL-shared-5.5.25-1.el6.x86_64.rpm
MySQL-shared-compat-5.5.25-1.el6.x86_64.rpm

rpm -e --nodeps mysql-libs
yum localinstall MySQL-*
		

# php ./configure bug, mysql库的地址是/usr/lib/, 让Makefile 使用/usr/lib64中的mysql库

ln -s /usr/lib64/mysql/* /usr/lib64/
ln -s /usr/lib64/libmysql* /usr/lib/

还可以使用 --with-libdir=lib64 指定目录
		
		
tar zxvf php-5.3.13.tar.gz
cd php-5.3.13

./configure --prefix=/srv/php-5.3.13 \
--with-config-file-path=/srv/php-5.3.13/etc \
--with-config-file-scan-dir=/srv/php-5.3.13/etc/conf.d \
--with-libdir=lib64 \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-pear \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib-dir \
--with-iconv \
--with-mcrypt \
--with-mysql \
--with-pdo-mysql \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-xmlrpc=shared \
--with-openssl=shared \
--with-mhash=shared \
--with-sqlite=shared \
--with-pdo-sqlite=shared \
--with-xsl=shared \
--with-pear \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--enable-magic-quotes \
--enable-inline-optimization \
--enable-gd-native-ttf \
--enable-zip \
--enable-xml \
--enable-ftp \
--enable-bcmath \
--enable-calendar \
--enable-sqlite-utf8 \
--enable-shmop \
--enable-dba \
--enable-wddx \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--disable-debug

make && make install
		
		
--with-snmp=shared \
		
ln -s /srv/php-5.3.13 /srv/php
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on

cp /srv/php/etc/php-fpm.conf.default /srv/php/etc/php-fpm.conf
cp php.ini-production /srv/php/etc/php.ini
		

php-fpm.conf

# grep -v ';' /srv/php/etc/php-fpm.conf | grep -v "^$"
[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
[www]
listen = 127.0.0.1:9000

user = www
group = www
pm = dynamic
pm.max_children = 2048
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35

pm.max_requests = 500

chkconfig --add php-fpm
		
comments powered by Disqus