湖濱散記部落格的樹心幽徑[login][主頁]
302:20141021-23在fedora 19 裝妥php5.4.34

(1)下載
[webadm@localhost ~]$ wget http://tw1.php.net/get/php-5.4.34.tar.gz/from/this/mirror
--2014-10-21 15:10:31--  http://tw1.php.net/get/php-5.4.34.tar.gz/from/this/mirror
正在查找主機 tw1.php.net (tw1.php.net)... 114.35.79.92
正在連接 tw1.php.net (tw1.php.net)|114.35.79.92|:80... 連上了。
已送出 HTTP 要求,正在等候回應... 302 Found
位置: http://tw1.php.net/distributions/php-5.4.34.tar.gz [跟隨至新的 URL]
--2014-10-21 15:10:31--  http://tw1.php.net/distributions/php-5.4.34.tar.gz
正在連接 tw1.php.net (tw1.php.net)|114.35.79.92|:80... 連上了。
已送出 HTTP 要求,正在等候回應... 200 OK
長度: 15333397 (15M) [application/x-gzip]
Saving to: ‘mirror’

100%[======================================>] 15,333,397   372KB/s   in 96s

2014-10-21 15:12:08 (155 KB/s) - ‘mirror’ saved [15333397/15333397]

[webadm@localhost ~]$ mv mirror php-5.4.34.tar.gz
[webadm@localhost ~]$


(2)解開php-5.4.34.tar.gz
[webadm@localhost ~]$ tar xvzf php-5.4.34.tar.gz



(3)察看安裝說明
[root@blackbear php-5.6.0]# cat INSTALL |more

(4)組態

[webadm@localhost ~]$ cd php-5.4.34/
[webadm@localhost php-5.4.34]$  ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql


(5)編譯

[webadm@localhost php-5.4.34]$ make


Build complete.
Don't forget to run 'make test'.

[webadm@localhost php-5.4.34]$ make test

FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (32 bit) [                                             ext/date/tests/bug41523.phpt]
Testing xpath() with invalid XML [ext/simplexml/tests/SimpleXMLElement_xpath.php                                             t]
Bug #64146 (serialize incorrectly saving objects when they are cloned) [ext/stan                                             dard/tests/serialize/bug64146.phpt]
Test setlocale() function : usage variations - Setting all available locales in                                              the platform [ext/standard/tests/strings/setlocale_variation2.phpt]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.  You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]: y

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text): xxx@XX

Posting to http://qa.php.net/buildtest-process.php

Thank you for helping to make PHP better.
[webadm@localhost php-5.4.34]$


(6)安裝
[root@localhost php-5.4.34]# make install
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install install libphp5.la /usr/local/apache2/modules/
libtool: install: install .libs/libphp5.so /usr/local/apache2/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/webadm/php-5.4.34/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
[activating module `php5' in /usr/local/apache2/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/php/man/man1/
Installing PHP CGI binary:        /usr/local/bin/
Installing PHP CGI man page:      /usr/local/php/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - already installed: 1.3.12
[PEAR] Console_Getopt - already installed: 1.3.1
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util       - already installed: 1.2.3
[PEAR] PEAR           - already installed: 1.9.5
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
/home/webadm/php-5.4.34/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers:          /usr/local/include/php/ext/pdo/
[root@localhost php-5.4.34]#

(7)重啟httpd
root@localhost php-5.4.34]#  /usr/local/apache2/bin/apachectl stop
[root@localhost php-5.4.34]#  /usr/local/apache2/bin/apachectl start
[root@localhost php-5.4.34]#


(8)PHP 順利運作
http://163.25.20.92/index.php

(9)裝GD並重編PHP

[root@localhost php-5.4.34]# yum install libpng
Loaded plugins: langpacks, refresh-packagekit
Package 2:libpng-1.5.13-3.fc19.i686 already installed and latest version
Nothing to do
[root@localhost php-5.4.34]# yum install libpng-devel
:
Installed:
  libpng-devel.i686 2:1.5.13-3.fc19

Complete!
[root@localhost php-5.4.34]#
[root@localhost php-5.4.34]# yum install libjpeg
Loaded plugins: langpacks, refresh-packagekit
Package libjpeg-turbo-1.3.1-2.fc19.i686 already installed and latest version
Nothing to do
[root@localhost php-5.4.34]# yum install libjpeg-devel
Loaded plugins: langpacks, refresh-packagekit
Package libjpeg-turbo-devel-1.3.1-2.fc19.i686 already installed and latest version
Nothing to do
[root@localhost php-5.4.34]#
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd

[root@localhost php-5.4.34]# make

[root@localhost php-5.4.34]# make install
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install install libphp5.la /usr/local/apache2/modules/
libtool: install: install .libs/libphp5.so /usr/local/apache2/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/webadm/php-5.4.34/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
[activating module `php5' in /usr/local/apache2/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/php/man/man1/
Installing PHP CGI binary:        /usr/local/bin/
Installing PHP CGI man page:      /usr/local/php/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - already installed: 1.3.12
[PEAR] Console_Getopt - already installed: 1.3.1
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util       - already installed: 1.2.3
[PEAR] PEAR           - already installed: 1.9.5
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
/home/webadm/php-5.4.34/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers:          /usr/local/include/php/ext/pdo/
[root@localhost php-5.4.34]#


select id,article_id,topic,text from lt_articles_text where article_id =302; ok. update lt_articles set num_reads=num_reads +1 where id=302; ok.