用户工具

站点工具


php_编译指南

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
php_编译指南 [2011/11/02 19:01] – 创建 alexphp_编译指南 [2011/11/13 17:39] (当前版本) – [Solaris 11] 64bit admin
行 1: 行 1:
 +====== PHP 编译指南 ======
  
 +编译安装在原则上参考[[编译指南|UNIX 环境编译指南]]中的描述进行。由于 PHP 不易编译,这里提供一些指导性意见。
 +===== 注意事项 =====
 +
 +PHP 的依赖较多,基本不会出现一次 configure 就执行通过的情况。请按照提示,安装上必要的依赖包,重新尝试编译。
 +
 +===== Configure =====
 +==== Solaris 11 ====
 +
 +Under Solaris 11, those packages are to be installed:
 +<code bash>
 +$ pfexec pkg install gd mysql-51/library
 +$ export CFLAGS='-I/usr/mysql/include -L/usr/mysql/lib/mysql'
 +$ export CXXFLAGS='-I/usr/mysql/include -L/usr/mysql/lib/mysql'
 +$ export LDFLAGS="-L/usr/mysql/lib/mysql"
 +</code>
 +(Remember that libmysql provided by Solaris 11 is 32-bit)
 +
 +And configure with
 +<code bash>
 +./configure --bindir=/usr/php/5.3/bin --datadir=/usr/php/5.3/share --exec-prefix=/usr/php/5.3 --includedir=/usr/php/5.3/include --libdir=/usr/php/5.3/lib --libexecdir=/usr/php/5.3/modules --mandir=/usr/php/5.3/man --oldincludedir=/usr/php/5.3/share --prefix=/usr/php/5.3 --sbindir=/usr/php/5.3/sbin --sysconfdir=/etc/php/5.3 --with-config-file-path=/etc/php/5.3 --with-config-file-scan-dir=/etc/php/5.3/conf.d --with-exec-dir=/usr/php/5.3/bin --disable-debug --with-cdb --disable-dmalloc --enable-shared --enable-fpm --enable-cli --enable-bcmath --enable-calendar --enable-ctype --enable-dom --enable-exif --enable-flatfile --enable-filter --enable-gd-native-ttf --enable-hash --enable-inifile --enable-json --enable-magic-quotes --enable-mbregex --enable-mbstring --enable-mod-charset --enable-pcntl --enable-posix --enable-libxml --enable-sqlite-utf8 --enable-session --enable-shmop --enable-short-tags --enable-simplexml --enable-zip --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-sqlite=shared --with-zlib --with-pear --with-mysql=/usr/mysql --with-mysql-sock --with-gd --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-curl=/usr
 +</code>
 +
 +Alternatively, you can download ''libmysql'' from [[http://dev.mysql.com/downloads/mirror.php?id=378017|MySQL website]], install it in ''/usr/local/mysql'', and configure with
 +<code bash>
 +CFLAGS=-m64
 +CXXFLAGS=-m64
 +./configure --bindir=/usr/php/5.3/bin --datadir=/usr/php/5.3/share --exec-prefix=/usr/php/5.3 --includedir=/usr/php/5.3/include --libdir=/usr/php/5.3/lib --libexecdir=/usr/php/5.3/modules --mandir=/usr/php/5.3/man --oldincludedir=/usr/php/5.3/share --prefix=/usr/php/5.3 --sbindir=/usr/php/5.3/sbin --sysconfdir=/etc/php/5.3 --with-config-file-path=/etc/php/5.3 --with-config-file-scan-dir=/etc/php/5.3/conf.d --with-exec-dir=/usr/php/5.3/bin --disable-debug --with-cdb --disable-dmalloc --enable-shared --enable-fpm --enable-cli --enable-bcmath --enable-calendar --enable-ctype --enable-dom --enable-exif --enable-flatfile --enable-filter --enable-gd-native-ttf --enable-hash --enable-inifile --enable-json --enable-magic-quotes --enable-mbregex --enable-mbstring --enable-mod-charset --enable-pcntl --enable-posix --enable-libxml --enable-sqlite-utf8 --enable-session --enable-shmop --enable-short-tags --enable-simplexml --enable-zip --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-sqlite=shared --with-zlib --with-pear --with-mysql=/usr/local/mysql --with-mysql-sock --with-gd --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-curl=/usr
 +</code>
 +to get 64-bit binary.
 +==== Solaris 10 / Linux ====
 +
 +<code bash>
 +./configure --bindir=/usr/php/5.3/bin --datadir=/usr/php/5.3/share --exec-prefix=/usr/php/5.3 --includedir=/usr/php/5.3/include --libdir=/usr/php/5.3/lib --libexecdir=/usr/php/5.3/modules --mandir=/usr/php/5.3/man --oldincludedir=/usr/php/5.3/share --prefix=/usr/php/5.3 --sbindir=/usr/php/5.3/sbin --sysconfdir=/etc/php/5.3 --with-config-file-path=/etc/php/5.3 --with-config-file-scan-dir=/etc/php/5.3/conf.d --with-exec-dir=/usr/php/5.3/bin --disable-debug --with-cdb --disable-dmalloc --enable-shared --enable-fpm --enable-cli --enable-bcmath --enable-calendar --enable-ctype --enable-dom --enable-exif --enable-flatfile --enable-filter --enable-gd-native-ttf --enable-hash --enable-inifile --enable-json --enable-magic-quotes --enable-mbregex --enable-mbstring --enable-mod-charset --enable-pcntl --enable-posix --enable-libxml --enable-sqlite-utf8 --enable-session --enable-shmop --enable-short-tags --enable-simplexml --enable-zip --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-sqlite=shared --with-zlib --with-pear --with-mysql --with-mysql-sock --with-gd --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-curl=/usr
 +</code>
 +
 +===== Installation =====
 +直接 make, make install 即可。
 +
 +===== 配置 =====
 +参见[[Linux Web 服务器(PHP)配置指南|Linux Web 服务器(PHP)配置指南]]以及[[PHP 调优经验|PHP 调优经验]]。