eygle.com   eygle.com
eygle.com eygle

« 郁闷的星期天清晨 | Blog首页 | 安装lilina news aggregator简介 »

在Redhat AD3上编译安装PHP5.0.4

[root@eygle opt]# wget http://cn2.php.net/get/php-5.0.4.tar.gz/from/cn.php.net/mirror
--00:56:34--  http://cn2.php.net/get/php-5.0.4.tar.gz/from/cn.php.net/mirror
           => `mirror'
Resolving cn2.php.net... done.
Connecting to cn2.php.net[]:80... 
[root@eygle opt]# wget http://cn.php.net/distributions/php-5.0.4.tar.gz
--00:57:37--  http://cn.php.net/distributions/php-5.0.4.tar.gz
           => `php-5.0.4.tar.gz'
Resolving cn.php.net... done.
Connecting to cn.php.net[]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5,839,214 [application/x-gzip]

100%[===============================================================>] 5,839,214      1.16M/s    ETA 00:00

00:57:42 (1.16 MB/s) - `php-5.0.4.tar.gz' saved [5839214/5839214]

[root@eygle opt]# gzip -d php-5.0.4.tar.gz 
[root@eygle opt]# tar -xvf php-5.0.4.tar 
[root@eygle opt]# cd php-5.0.4
[root@eygle php-5.0.4]# ls
acconfig.h        ext              missing                           README.QNX                        snapshot
acconfig.h.in     EXTENSIONS       mkinstalldirs                     README.SELF-CONTAINED-EXTENSIONS  stamp-h.in
acinclude.m4      footer           netware                           README.STREAMS                    stub.c
aclocal.m4        generated_lists  NEWS                              README.SUBMITTING_PATCH           tests
build             genfiles         pear                              README.TESTING                    TODO
buildconf         header           php5.spec.in                      README.TESTING2                   TODO-5.1
buildconf.bat     INSTALL          php.gif                           README.UNIX-BUILD-SYSTEM          TODO.BUILDv5
CODING_STANDARDS  install-sh       php.ini-dist                      README.WIN32-BUILD-SYSTEM         TODO-PHP5
config.guess      LICENSE          php.ini-recommended               README.Zeus                       TSRM
config.sub        ltmain.sh        README.CVS-RULES                  regex                             win32
configure         main             README.EXTENSIONS                 run-tests-config.php              Zend
configure.in      makedist         README.EXT_SKEL                   run-tests.php
CREDITS           Makefile.frag    README.input_filter               sapi
cvsclean          Makefile.global  README.PARAMETER_PARSING_API      scripts
cvsclean.bat      makerpm          README.PHP4-TO-PHP5-THIN-CHANGES  server-tests.php

[root@eygle php-5.0.4]# ./configure  --enable-track-vars --with-mysql --with-dom --with-zlib-dir 
--with-curl --with-iconv --with-mbstring --enable-module=so --with-apxs2
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.

[root@eygle php-5.0.4]# ./configure --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql 
--enable-track-vars --with-dom --with-zlib-dir --with-curl --with-iconv --with-mbstring
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... (cached) gcc
creating libtool

Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/php-config
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |

Thank you for using PHP.

[root@eygle php-5.0.4]# make

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

[root@eygle php-5.0.4]# make install
Installing PHP SAPI module:       apache2handler
/opt/apache/build/instdso.sh SH_LIBTOOL='/opt/apache/build/libtool' libphp5.la /opt/apache/modules
/opt/apache/build/libtool --mode=install cp libphp5.la /opt/apache/modules/
cp .libs/libphp5.so /opt/apache/modules/libphp5.so
cp .libs/libphp5.lai /opt/apache/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /opt/php-5.0.4/libs'
chmod 755 /opt/apache/modules/libphp5.so
[activating module `php5' in /opt/apache/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR           - already installed: 1.3.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
[PEAR] HTML_Template_IT- already installed: 1.1
[PEAR] Net_UserAgent_Detect- already installed: 2.0.1
[PEAR] XML_RPC        - already installed: 1.2.2
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
  program: phpextdist

[root@eygle php-5.0.4]# libtool --finish /opt/php-5.0.4/libs
PATH="$PATH:/sbin" ldconfig -n /opt/php-5.0.4/libs
Libraries have been installed in:

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

[root@eygle bin]# ln -s /opt/php/bin/php /usr/bin
[root@eygle bin]# which php
[root@eygle bin]# php -v
PHP 5.0.4 (cli) (built: Aug 14 2005 01:11:42)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

以加载新的php module
[root@eygle opt]# apachectl stop
[root@eygle opt]# apachectl start

正常情况下,到这里就应该正常了,可是我却发现php不能正常使用,在error log里记录了类似如下的错误:
[root@eygle logs]# tail -f error_log 
[Sun Aug 14 03:48:17 2005] [notice] child pid 27697 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:17 2005] [notice] child pid 27705 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:22 2005] [notice] child pid 27707 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:25 2005] [notice] child pid 27683 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:30 2005] [notice] child pid 27686 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:36 2005] [notice] child pid 27685 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:37 2005] [notice] child pid 27709 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:38 2005] [notice] child pid 27711 exit signal Segmentation fault (11)

[Sun Aug 14 03:47:50 2005] [notice] caught SIGTERM, shutting down
[Sun Aug 14 03:47:53 2005] [notice] Apache/2.0.49 (Unix) DAV/2 PHP/4.4.0 PHP/5.0.4 configured 
-- resuming normal operations

在Apache启动时记录了两个PHP版本:PHP/4.4.0 PHP/5.0.4
LoadModule php4_module        modules/libphp4.so
LoadModule php5_module        modules/libphp5.so


    >> 2013-08-14文章:
    >> 2012-08-14文章:
    >> 2009-08-14文章:
    >> 2008-08-14文章:
           在兰州 在路上 在家里
    >> 2006-08-14文章:


By eygle on 2005-08-14 14:21 | Comments (0) | Web | 386 |

CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com