需要GD库大于2.1版本
编译GD库请参考文章 安装GD库
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg/ --with-freetype-dir=/usr/local/freetype/ --with-gd --with-mcrypt=/usr/local/libmcrypt/ --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --enable-fpm --with-fpm-user=webroot --with-fpm-group=webroot
[[email protected] php-5.5.26]# pwd
/usr/src/php-5.5.26
acinclude.m4 configure install-sh Makefile.global php.gif README.NEW-OUTPUT-API README.WIN32-BUILD-SYSTEM tests
aclocal.m4 configure.in libs Makefile.objects php.ini-development README.PARAMETER_PARSING_API run-tests.php travis
build CREDITS libtool makerpm php.ini-production README.PHP4-TO-PHP5-THIN-CHANGES sapi TSRM
buildconf ext LICENSE missing php_test_results_20150821_1027.txt README.REDIST.BINS scripts UPGRADING
buildconf.bat EXTENSIONS ltmain.sh mkinstalldirs README.EXTENSIONS README.RELEASE_PROCESS server-tests-config.php UPGRADING.INTERNALS
CODING_STANDARDS footer main modules README.EXT_SKEL README.SELF-CONTAINED-EXTENSIONS server-tests.php vcsclean
config.guess generated_lists makedist netware README.GIT-RULES README.STREAMS sessions win32
config.log genfiles Makefile NEWS README.input_filter README.SUBMITTING_PATCH snapshot Zend
config.nice header Makefile.frag pear README.MAILINGLIST_RULES README.TESTING stamp-h.in
config.status include Makefile.fragments php5.spec README.md README.TESTING2 stub.c
config.sub INSTALL Makefile.gcov php5.spec.in README.namespaces README.UNIX-BUILD-SYSTEM svnclean.bat
[[email protected] php-5.5.26]# cp php.ini-development /usr/local/php/etc/php.ini
[[email protected] php-5.5.26]# cd /usr/local/php/
bin etc include lib php sbin var
pear.conf php-fpm.conf.default php.ini
[[email protected] etc]# cp php-fpm.conf.default php-fpm.conf
编译openssl扩展
[[email protected] src]# cd php-5.5.26
acinclude.m4 configure install-sh Makefile.global php.gif README.NEW-OUTPUT-API R
aclocal.m4 configure.in libs Makefile.objects php.ini-development README.PARAMETER_PARSING_API r
build CREDITS libtool makerpm php.ini-production README.PHP4-TO-PHP5-THIN-CHANGES s
buildconf ext LICENSE missing php_test_results_20150821_1027.txt README.REDIST.BINS s
buildconf.bat EXTENSIONS ltmain.sh mkinstalldirs README.EXTENSIONS README.RELEASE_PROCESS s
CODING_STANDARDS footer main modules README.EXT_SKEL README.SELF-CONTAINED-EXTENSIONS s
config.guess generated_lists makedist netware README.GIT-RULES README.STREAMS s
config.log genfiles Makefile NEWS README.input_filter README.SUBMITTING_PATCH s
config.nice header Makefile.frag pear README.MAILINGLIST_RULES README.TESTING s
config.status include Makefile.fragments php5.spec README.md README.TESTING2 s
config.sub INSTALL Makefile.gcov php5.spec.in README.namespaces README.UNIX-BUILD-SYSTEM s
[[email protected] php-5.5.26]# cd ext/
bcmath dba fileinfo iconv mbstring odbc pdo_firebird phar shmop sqlite3 tokenizer zip
bz2 dom filter imap mcrypt opcache pdo_mysql posix simplexml standard wddx zlib
calendar enchant ftp interbase mssql openssl pdo_oci pspell skeleton sybase_ct xml
com_dotnet ereg gd intl mysql pcntl pdo_odbc readline snmp sysvmsg xmlreader
ctype exif gettext json mysqli pcre pdo_pgsql recode soap sysvsem xmlrpc
curl ext_skel gmp ldap mysqlnd pdo pdo_sqlite reflection sockets sysvshm xmlwriter
date ext_skel_win32.php hash libxml oci8 pdo_dblib pgsql session spl tidy xsl
[[email protected] openssl]# /usr/local/php/bin/phpize
Cannot find config.m4.
Make sure that you run ‘/usr/local/php/bin/phpize‘ in the top level source directory of the module
把config0.m4 重命名为 config.m4
[[email protected] openssl]# mv config0.m4 config.m4
[[email protected] openssl]# ./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
make && make install
/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
修改php.ini配置文件
原文:http://my.oschina.net/yonghan/blog/495364