1. 程式人生 > >我的PHP編譯日誌

我的PHP編譯日誌

php build

build install 按需使用:


wget http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz/download

tar -xzvf pcre-8.33.tar.gz

cd pcre-8.33

./configure

make

make install


PHP 參見 http://docs.php.net/manual/en/pthreads.installation.php

yum install libxml2

yum install libxml2-devel -y

如果編譯libxml2,需要先安裝zlib(如果沒有安裝)

yum install zlib zlib-devel

PHP 2.9.0編譯通過,見G3.5備份目錄


/*不再需要thread

tar -xzf pthreads-2.0.10.tgz

mv pthreads-2.0.10 php-5.6.7/ext/pthreads

./buildconf --force

rm -rf autom4te.cache/

rm aclocal.m4

./buildconf --force

./configure --help | grep pthreads

*/

./configure --prefix=/usr/local/php --enable-fpm --enable-maintainer-zts --with-mysql --with-pdo-mysql

要用pdo,在php.ini中加入: pdo_mysql.default_socket="/var/lib/mysql/mysql.sock"

make

make install


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

#modify /usr/local/php/etc/php-fpm.conf

cd /usr/local/php/sbin

./php-fpm -c ../etc


編譯phalcon

如果找不到php環境,需要修改install文件,最後一句:

./install

/usr/local/php/bin/phpize && ./configure --enable-phalcon --with-php-config=/usr/local/php/bin/php-config && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation"



mysql安裝

yum install mysql

yum install mysql-community-server


用mysqli和curl的編譯命令

yum install curl curl-devel

./configure --prefix=/usr/local/php --enable-fpm --enable-maintainer-zts --with-mysql --with-pdo-mysql --with-mysqli --with-curl


去掉--enable-maintainer-zts

./configure --prefix=/usr/local/php --enable-fpm --with-mysql --with-pdo-mysql --with-mysqli --with-curl


增加GD

./configure --prefix=/usr/local/php --enable-fpm --with-mysql --with-pdo-mysql --with-mysqli --with-curl --with-gd --with-png-dir=../libpng-1.6.29 --with-jpeg-dir=../jpeg-9b

spec要把libpng libjpeg等庫打進去

/usr/local/lib/libpng*


我的PHP編譯日誌