archlinux下编译PHP

arch版的PHP功能也蛮不错了。不过还是想自己编译一个,因为有些我需要的功能它没有。。。
写此文仅记录折腾过程。

接上一篇,《win7/archlinux双系统安装手记(二)》,由于有些库已经安装了,因此下面的可能不完全:

1
2
3
4
5
6
7
8
9
10
11
12
 sudo pacman -S libxml2
sudo pacman -S bzip2
sudo pacman -Sdiffutils patch
 sudo pacman -S subversion
 sudo pacman -S  bison
 sudo pacman -S zlib
 sudo pacman -S libevent
 sudo pacman -S curl
sudo pacman -S openssl
php-apc php-curl php-intl php-suhosin php-xsl  php-docs  php-memcached php-suhosin
sudo pacman -S automake autoconf intltool gcc glibc
sudo pacman -S flex
1
2
3
4
5
6
7
8
wget http://cn.php.net/distributions/php-5.3.6.tar.bz2
tar -xvjf php-5.3.6.tar.bz2
cd php-5.3.6-3
sudo ./configure --srcdir=../php-5.3.6 --prefix=/usr --sysconfdir=/etc/php --localstatedir=/var --with-layout=GNU --with-config-file-path=/etc/php --with-config-file-scan-dir=/etc/php/conf.d --enable-inline-optimization --disable-debug --disable-rpath --disable-static --enable-shared --mandir=/usr/share/man --with-pear=shared --enable-cli --with-apxs2 --enable-bcmath=shared --enable-calendar=shared --enable-dba=shared --enable-exif=shared --enable-ftp=shared --enable-gd-native-ttf --enable-intl=shared --enable-json=shared --enable-mbregex --enable-mbstring --enable-pdo --enable-phar=shared --enable-posix=shared --enable-session --enable-shmop=shared --enable-soap=shared --enable-sockets=shared --enable-sqlite-utf8 --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --enable-xml --enable-zip=shared --with-bz2=shared --with-curl=shared --with-db4=/usr --with-enchant=shared,/usr --with-freetype-dir=shared,/usr --with-gd=shared --with-gdbm=shared --with-gettext=shared --with-gmp=shared --with-iconv=shared --with-icu-dir=/usr --without-imap-ssl --without-imap --with-jpeg-dir=shared,/usr --with-ldap=shared --with-ldap-sasl --with-mcrypt=shared --with-mhash --without-mssql --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-mysql=shared,mysqlnd --with-mysqli=shared,mysqlnd --with-openssl=shared --with-pcre-regex=/usr --with-pdo-mysql=shared,mysqlnd --with-pdo-odbc=shared,unixODBC,/usr --without-pdo-pgsql --with-pdo-sqlite=shared,/usr --without-pgsql --with-png-dir=shared,/usr --with-pspell=shared --with-regex=php --without-snmp --with-sqlite3=shared,/usr --with-sqlite=shared --with-tidy=shared --with-unixODBC=shared,/usr --with-xmlrpc=shared --with-xsl=shared --with-zlib --without-db2 --without-db3
sudo make
#如果make出错的话,试用sudo make ZEND_EXTRA_LIBS='-liconv'
sudo make test
#这里测试要蛮久,1万多项呢。。。 <img src='http://ihacklog.com/data/views/public/assets/images/smilies/icon_exclaim.gif' alt=':!:' class='wp-smiley' />

测试结果终于出来了,有些小BUG,不过不影响使用:

WARNED TEST SUMMARY
———————————————————————
DateInterval::format(), %a [ext/date/tests/DateInterval_format_a.phpt] (warn: XFAIL section but test passes)
via [ext/pdo_sqlite/tests/common.phpt]
SQLite PDO Common: Bug #34630 (inserting streams as LOBs) [ext/pdo_sqlite/tests/bug_34630.phpt] (warn: XFAIL section but test passes)
via [ext/sqlite/tests/pdo/common.phpt]
SQLite2 PDO Common: Bug #34630 (inserting streams as LOBs) [ext/sqlite/tests/pdo/bug_34630.phpt] (warn: XFAIL section but test passes)
Bug #39863 (file_exists() silently truncates after a null byte) [ext/standard/tests/file/bug39863.phpt] (warn: XFAIL section but test passes)
=====================================================================

You may have found a problem in PHP.
We would like to send this report automatically to the
PHP QA team, to give us a better understanding of how
the test cases are doing. If you don’t want to send it
immediately, you can choose “s” to save the report to
a file that you can send us later.
Do you want to send this report now? [Yns]: Y

安装

1
[admin@HuangYe php-5.3.6]$ sudo make install

Installing PHP SAPI module: apache2handler
/usr/lib/httpd/build/instdso.sh SH_LIBTOOL=’/usr/share/apr-1/build/libtool’ libphp5.la /usr/lib/httpd/modules
/usr/share/apr-1/build/libtool –mode=install cp libphp5.la /usr/lib/httpd/modules/
libtool: install: cp .libs/libphp5.so /usr/lib/httpd/modules/libphp5.so
libtool: install: cp .libs/libphp5.lai /usr/lib/httpd/modules/libphp5.la
libtool: install: warning: remember to run `libtool –finish /usr/local/src/php-5.3.6/libs’
chmod 755 /usr/lib/httpd/modules/libphp5.so
[activating module `php5' in /etc/httpd/conf/httpd.conf]
Installing PHP CLI binary: /usr/bin/
Installing PHP CLI man page: /usr/share/man/man1/
Installing shared extensions: /usr/lib/php/20090626/
Installing build environment: /usr/lib/php/build/
Installing header files: /usr/include/php/
Installing helper programs: /usr/bin/
program: phpize
program: php-config
Installing man pages: /usr/share/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/share/pear/
[PEAR] Archive_Tar – installed: 1.3.7
[PEAR] Console_Getopt – installed: 1.3.0
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util – installed: 1.2.1
[PEAR] PEAR – installed: 1.9.2
Wrote PEAR system config file at: /etc/php/pear.conf
You may want to add: /usr/share/pear to your php.ini include_path
/usr/local/src/php-5.3.6/build/shtool install -c ext/phar/phar.phar /usr/bin
ln -s -f /usr/bin/phar.phar /usr/bin/phar
Installing PDO headers: /usr/include/php/ext/pdo/

更多
No Responses Post a comment

Leave a Reply

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS