UJP - 技術情報1

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

PHP5.1.4をRedHatES3.0のApache1.3環境にインストール

PHP5.1.6をRedHatES3.0のApache1.3環境にインストール


0.改訂履歴

  • 2006.10.11 新規作成

1.はじめに

 このドキュメントでは,RedHat ES3.0に,PHP5.1.6をインストールする手順を説明する. また,Apache1.3.37と連携させる様にコンパイルを行う.この手順を実行するためには,ライブラリ参照や実行モジュールを必要とするため,事前にApacheとMySQLをインストールしておく. この手順の中で,libxml2が必要となるので,そのパッケージのインストール方法についても記載している.

2.PHPモジュールの取得

  • 公式サイトから取得する.
[root@orpheus Download]$ wget http://jp.php.net/get/php-5.1.6.tar.gz
/from/this/mirror
--11:11:58--  http://jp.php.net/get/php-5.1.6.tar.gz/from/this/mirror
           => `mirror.1'
Resolving jp.php.net... 61.195.146.164
Connecting to jp.php.net[61.195.146.164]:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://jp.php.net/distributions/php-5.1.6.tar.gz [following]
--11:11:58--  http://jp.php.net/distributions/php-5.1.6.tar.gz
           => `php-5.1.6.tar.gz'
Connecting to jp.php.net[61.195.146.164]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8,187,896 [application/x-tar]

100%[=================================================================
==>] 8,187,896      2.17M/s    ETA 00:00

11:12:02 (2.17 MB/s) - `php-5.1.6.tar.gz' saved [8,187,896/8,187,896]

[root@orpheus Download]$
  • 展開して中身を確認する.
[root@orpheus Download]# tar xzf php-5.1.6.tar.gz
[root@orpheus Download]# cd php-5.1.6
[root@orpheus php-5.1.6]# ls
acconfig.h        generated_lists  php5.spec.in                      README.Zeus
acconfig.h.in     genfiles         php.gif                           regex
acinclude.m4      header           php.ini-dist                      run-tests.php
aclocal.m4        INSTALL          php.ini-recommended               sapi
build             install-sh       README.CVS-RULES                  scripts
buildconf         LICENSE          README.EXTENSIONS                 server-tests
-config.php
buildconf.bat     ltmain.sh        README.EXT_SKEL                   server-tests.php
CODING_STANDARDS  main             README.input_filter               snapshot
config.guess      makedist         README.PARAMETER_PARSING_API      stamp-h.in
config.sub        Makefile.frag    README.PHP4-TO-PHP5-THIN-CHANGES  stub.c
configure         Makefile.gcov    README.QNX                        tests
configure.in      Makefile.global  README.SELF-CONTAINED-EXTENSIONS  TODO
CREDITS           makerpm          README.STREAMS                    TODO-5.1
cvsclean          missing          README.SUBMITTING_PATCH           TODO-PHP5
cvsclean.bat      mkinstalldirs    README.TESTING                    TSRM
ext               netware          README.TESTING2                   UPGRADING
EXTENSIONS        NEWS             README.UNIX-BUILD-SYSTEM          win32
footer            pear             README.WIN32-BUILD-SYSTEM         Zend
[root@orpheus php-5.1.6]# 

3.php5のコンパイル

  • Apacheのコマンドを検索する.
[root@orpheus php-5.1.6]# locate apxs
/root/Download/apache_1.3.36/htdocs/manual/programs/apxs.html
/root/Download/apache_1.3.36/src/support/apxs.8
/root/Download/apache_1.3.36/src/support/apxs.pl
/root/Download/apache_1.3.36/src/support/apxs
/usr/share/man/fr/man1/apxs.1.gz
/usr/local/apache/bin/apxs
/usr/local/apache/man/man8/apxs.8
/usr/local/apache/htdocs/manual/programs/apxs.html
[root@orpheus php-5.1.6]# 
  • /usr/sbin/apxsにあるのはRedHat ES3に最初から入っているApache2用なので間違えないようにする.
  • 今回は,画像変換用のgdも一緒にインストールを行う. そのためにzlibも必要となる.
[root@orpheus php-5.1.6]# ./configure --enable-mbstring ¥
> --enable-mbregex --with-apxs=/usr/local/apache/bin/apxs ¥
> --with-gd --with-zlib --with-mysql --with-ttf --with-openssl --with-curl
creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking whether ln -s works... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for re2c... no
configure: warning: You will need re2c 0.9.11 or later if you want to regenera
te PHP parsers.
checking for gawk... gawk
checking for bison... bison -y
checking for bison version... 1.875 (ok)
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for working const... yes
checking for flex version... 2.5.4 (ok)
checking whether to force non-PIC code in shared modules... yes
checking for pthreads_cflags... -pthread
checking for pthreads_lib... 

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... yes
checking for mod_charset compatibility option... no
checking for member fd in BUFF *... yes
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support... no
checking for mod_charset compatibility option... no
checking for Caudium support... no
checking for CLI build... yes
checking for Continuity support... no
checking for embedded SAPI library support... no
checking for Zeus ISAPI support... no
checking for Milter support... no
checking for NSAPI support... no
checking for PHTTPD support... no
checking for Pi3Web support... no
checking for Roxen/Pike support... no
checking for thttpd... no
checking for TUX... no
checking for webjames... no
checking for chosen SAPI module... apache

Running system checks
checking for sendmail... /usr/sbin/sendmail
checking whether system uses EBCDIC... no
checking whether byte ordering is bigendian... no
checking for socket... yes
checking for socketpair... yes
checking for htonl... yes
checking for gethostname... yes
checking for gethostbyaddr... yes
checking for yp_get_default_domain... no
checking for __yp_get_default_domain... no
checking for yp_get_default_domain in -lnsl... yes
checking for dlopen... no
checking for __dlopen... no
checking for dlopen in -ldl... yes
checking for sin in -lm... yes
checking for res_search... no
checking for __res_search... no
checking for res_search in -lresolv... yes
checking for inet_aton... yes
checking for dn_skipname... no
checking for __dn_skipname... yes
checking for ANSI C header files... yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking for inttypes.h... yes
checking for stdint.h... yes
checking for dirent.h... yes
checking for ApplicationServices/ApplicationServices.h... no
checking for sys/param.h... yes
checking for sys/types.h... yes
checking for sys/time.h... yes
checking for netinet/in.h... yes
checking for alloca.h... yes
checking for arpa/inet.h... yes
checking for arpa/nameser.h... yes
checking for assert.h... yes
checking for crypt.h... yes
checking for fcntl.h... yes
checking for grp.h... yes
checking for ieeefp.h... no
checking for langinfo.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for monetary.h... yes
checking for mach-o/dyld.h... no
checking for netdb.h... yes
checking for pwd.h... yes
checking for resolv.h... yes
checking for signal.h... yes
checking for stdarg.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for syslog.h... yes
checking for sysexits.h... yes
checking for sys/ioctl.h... yes
checking for sys/file.h... yes
checking for sys/mman.h... yes
checking for sys/mount.h... yes
checking for sys/poll.h... yes
checking for sys/resource.h... yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/statfs.h... yes
checking for sys/statvfs.h... yes
checking for sys/vfs.h... yes
checking for sys/sysexits.h... no
checking for sys/varargs.h... no
checking for sys/wait.h... yes
checking for termios.h... yes
checking for unistd.h... yes
checking for unix.h... no
checking for utime.h... yes
checking for sys/utsname.h... yes
checking for sys/ipc.h... yes
checking for dlfcn.h... yes
checking for assert.h... (cached) yes
checking for fopencookie... yes
checking for broken getcwd... no
checking for broken libc stdio... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... yes
checking for missing declarations of reentrant functions... done
checking for fclose declaration... ok
checking for tm_gmtoff in struct tm... yes
checking for struct flock... yes
checking for socklen_t... yes
checking size of intmax_t... 0
checking size of size_t... 4
checking size of ssize_t... 0
checking size of ptrdiff_t... 0
checking size of long long... 8
checking size of long long int... 8
checking size of long... 4
checking size of int... 4
checking for st_blksize in struct stat... yes
checking for st_blocks in struct stat... yes
checking for st_rdev in struct stat... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for struct sockaddr_storage... yes
checking for field sa_len in struct sockaddr... no
checking for IPv6 support... yes
checking for vprintf... yes
checking for alphasort... yes
checking for asctime_r... yes
checking for chroot... yes
checking for ctime_r... yes
checking for cuserid... yes
checking for crypt... no
checking for flock... yes
checking for ftok... yes
checking for funopen... no
checking for gai_strerror... yes
checking for gcvt... yes
checking for getloadavg... yes
checking for getlogin... yes
checking for getprotobyname... yes
checking for getprotobynumber... yes
checking for getservbyname... yes
checking for getservbyport... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for gmtime_r... yes
checking for grantpt... yes
checking for inet_ntoa... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for isascii... yes
checking for link... yes
checking for localtime_r... yes
checking for lockf... yes
checking for lchown... yes
checking for lrand48... yes
checking for memcpy... yes
checking for memmove... yes
checking for mkstemp... yes
checking for mmap... yes
checking for nl_langinfo... yes
checking for perror... yes
checking for poll... yes
checking for ptsname... yes
checking for putenv... yes
checking for realpath... yes
checking for random... yes
checking for rand_r... yes
checking for regcomp... yes
checking for res_search... (cached) yes
checking for scandir... yes
checking for setitimer... yes
checking for setlocale... yes
checking for localeconv... yes
checking for setpgid... yes
checking for setsockopt... yes
checking for setvbuf... yes
checking for shutdown... yes
checking for sin... yes
checking for snprintf... yes
checking for srand48... yes
checking for srandom... yes
checking for statfs... yes
checking for statvfs... yes
checking for std_syslog... no
checking for strcasecmp... yes
checking for strcoll... yes
checking for strdup... yes
checking for strerror... yes
checking for strftime... yes
checking for strptime... yes
checking for strstr... yes
checking for strtok_r... yes
checking for symlink... yes
checking for tempnam... yes
checking for tzset... yes
checking for unlockpt... yes
checking for unsetenv... yes
checking for usleep... yes
checking for nanosleep... yes
checking for utime... yes
checking for vsnprintf... yes
checking for getaddrinfo... yes
checking for strlcat... no
checking for strlcpy... no
checking for getopt... yes
checking whether utime accepts a null argument... yes
checking for working alloca.h... (cached) yes
checking for alloca... yes
checking for declared timezone... yes
checking for type of reentrant time-related functions... POSIX
checking for readdir_r... yes
checking for type of readdir_r... POSIX
checking for in_addr_t... yes

General settings
checking whether to include gcov symbols... no
checking whether to include debugging symbols... no
checking layout of installed files... PHP
checking path to configuration file... DEFAULT
checking where to scan for configuration files... DEFAULT
checking whether to enable safe mode by default... no
checking for safe mode exec dir... /usr/local/php/bin
checking whether to enable PHP's own SIGCHLD handler... no
checking whether to enable magic quotes by default... no
checking whether to enable runpaths... yes
checking whether to explicitly link against libgcc... no
checking whether to enable short tags by default... yes
checking whether to enable dmalloc... no
checking whether to enable IPv6 support... yes
checking how big to make fd sets... using system default
checking whether to enable versioning... no

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
configure: error: libxml2 version 2.6.11 or greater required.
[root@orpheus php-5.1.6]#
  • libxmlを確認してみる.
[root@orpheus php-5.1.6]# rpm -qa | grep libxml
libxml2-2.5.10-7
libxml2-python-2.5.10-7
perl-libxml-perl-0.07-28
libxml2-devel-2.5.10-7
perl-libxml-enno-1.02-29
libxml-1.8.17-9.2
[root@orpheus php-5.1.6]#
  • 必要としているバージョンより古い事がわかる.

4.libxml2のインストール

  • 公式サイトから,モジュールをダウンロードする.
    • The XML C parser and toolkit of Gnome
      • http://xmlsoft.org/
  • このサイト上のリンクで,RPMを配布しているサイトが紹介されているので,そこからダウンロードする.
    • RPM resource libxml2
      • http://rpmfind.net/linux/rpm2html/search.php?query=libxml2
  • ダウンロードする際に,バージョンに気をつける.
    • RPMの場合は,コンパイルしている環境のglibcのバージョンに依存する為,新しすぎるとFedora 4やRedHat ES4用なので.RedHat ES3ではここで紹介する方法ではインストールできない.
  • まずは,ディレクトリを1つ上に移動する.
[root@orpheus php-5.1.6]# cd ../
[root@orpheus Download]# 
  • モジュールを取得する.
[root@orpheus Download]$ wget ftp://194.199.20.114/linux/fedora/core/updates
/3/i386/libxml2-2.6.16-3.i386.rpm
--11:56:40--  ftp://194.199.20.114/linux/fedora/core/updates/3/i386/libxml2-2.
6.16-3.i386.rpm
           => `libxml2-2.6.16-3.i386.rpm'
Connecting to 194.199.20.114:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /linux/fedora/core/updates/3/i386 ... done.
==> PASV ... done.    ==> RETR libxml2-2.6.16-3.i386.rpm ... done.
Length: 634,176 (unauthoritative)

100%[=========================================================================
=============================================>] 634,176      144.06K/s    ETA 
00:00

11:56:48 (143.84 KB/s) - `libxml2-2.6.16-3.i386.rpm' saved [634,176]

[root@orpheus root]$

[root@orpheus root]$ wget ftp://194.199.20.114/linux/fedora/core/updates
/3/i386/libxml2-devel-2.6.16-3.i386.rpm
--11:55:34--  ftp://194.199.20.114/linux/fedora/core/updates/3/i386/libxml2-de
vel-2.6.16-3.i386.rpm
           => `libxml2-devel-2.6.16-3.i386.rpm'
Connecting to 194.199.20.114:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /linux/fedora/core/updates/3/i386 ... done.
==> PASV ... done.    ==> RETR libxml2-devel-2.6.16-3.i386.rpm ... done.
Length: 1,840,151 (unauthoritative)

100%[=========================================================================
=============================================>] 1,840,151    203.06K/s    ETA 
00:00

11:55:48 (177.85 KB/s) - `libxml2-devel-2.6.16-3.i386.rpm' saved [1,840,151]

[root@orpheus Download]$ 
  • ダウンロードしたファイルを確認する.
[root@orpheus Download]# ls -la *xml*
-rw-r--r--  1 root  users      634176 Oct 11 12:06 libxml2-2.6.16-3.i386.rpm
-rw-r--r--  1 root  users     1840151 Oct 11 12:06 libxml2-devel-2.6.16-3.i3
86.rpm
[root@orpheus Download]# 
  • 現在のlibxmlインストールバージョンを確認する.
[root@orpheus Download]# rpm -qa | grep libxml
libxml2-2.5.10-7
libxml2-python-2.5.10-7
perl-libxml-perl-0.07-28
libxml2-devel-2.5.10-7
perl-libxml-enno-1.02-29
libxml-1.8.17-9.2
[root@orpheus Download]#
  • 古いのでlibxml2だけ,削除する.
[root@orpheus Download]# rpm -e --nodeps libxml2-2.5.10-7
[root@orpheus Download]# rpm -e --nodeps libxml2-python-2.5.10-7
[root@orpheus Download]# rpm -e --nodeps libxml2-devel-2.5.10-7
[root@orpheus Download]# rpm -qa | grep libxml
perl-libxml-perl-0.07-28
perl-libxml-enno-1.02-29
libxml-1.8.17-9.2
[root@orpheus Download]#
  • ダウンロードしたRPMをインストールする.
[root@orpheus Download]# rpm -ihv libxml2-2.6.16-3.i386.rpm
warning: libxml2-2.6.16-3.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...                ########################################### [100%]
   1:libxml2                ########################################### [100%]
[root@orpheus Download]# rpm -ihv libxml2-devel-2.6.16-3.i386.rpm
warning: libxml2-devel-2.6.16-3.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...                ########################################### [100%]
   1:libxml2-devel          ########################################### [100%]
[root@orpheus Download]# 
  • 古いバージョンがインストールされているので,これを削除する.
  • インストール完了.
  • 再度PHPをコンパイルしてみる.
[root@orpheus Download] cd php-5.1.6
[root@orpheus php-5.1.6]# rm config.cache
rm: remove regular empty file `config.cache'? y
[root@orpheus php-5.1.6]# ./configure --enable-mbstring --enable-mbregex ¥
> --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib ¥ 
> --with-mysql --with-ttf --with-openssl --with-curl
creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking whether ln -s works... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for re2c... no
configure: warning: You will need re2c 0.9.11 or later if you want to regenera
te PHP parsers.
checking for gawk... gawk
checking for bison... bison -y
checking for bison version... 1.875 (ok)
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for working const... yes
checking for flex version... 2.5.4 (ok)
checking whether to force non-PIC code in shared modules... yes
checking for pthreads_cflags... -pthread
checking for pthreads_lib... 

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... yes
checking for mod_charset compatibility option... no
checking for member fd in BUFF *... yes
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support... no
checking for mod_charset compatibility option... no
checking for Caudium support... no
checking for CLI build... yes
checking for Continuity support... no
checking for embedded SAPI library support... no
checking for Zeus ISAPI support... no
checking for Milter support... no
checking for NSAPI support... no
checking for PHTTPD support... no
checking for Pi3Web support... no
checking for Roxen/Pike support... no
checking for thttpd... no
checking for TUX... no
checking for webjames... no
checking for chosen SAPI module... apache

Running system checks
checking for sendmail... /usr/sbin/sendmail
checking whether system uses EBCDIC... no
checking whether byte ordering is bigendian... no
checking for socket... yes
checking for socketpair... yes
checking for htonl... yes
checking for gethostname... yes
checking for gethostbyaddr... yes
checking for yp_get_default_domain... no
checking for __yp_get_default_domain... no
checking for yp_get_default_domain in -lnsl... yes
checking for dlopen... no
checking for __dlopen... no
checking for dlopen in -ldl... yes
checking for sin in -lm... yes
checking for res_search... no
checking for __res_search... no
checking for res_search in -lresolv... yes
checking for inet_aton... yes
checking for dn_skipname... no
checking for __dn_skipname... yes
checking for ANSI C header files... yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking for inttypes.h... yes
checking for stdint.h... yes
checking for dirent.h... yes
checking for ApplicationServices/ApplicationServices.h... no
checking for sys/param.h... yes
checking for sys/types.h... yes
checking for sys/time.h... yes
checking for netinet/in.h... yes
checking for alloca.h... yes
checking for arpa/inet.h... yes
checking for arpa/nameser.h... yes
checking for assert.h... yes
checking for crypt.h... yes
checking for fcntl.h... yes
checking for grp.h... yes
checking for ieeefp.h... no
checking for langinfo.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for monetary.h... yes
checking for mach-o/dyld.h... no
checking for netdb.h... yes
checking for pwd.h... yes
checking for resolv.h... yes
checking for signal.h... yes
checking for stdarg.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for syslog.h... yes
checking for sysexits.h... yes
checking for sys/ioctl.h... yes
checking for sys/file.h... yes
checking for sys/mman.h... yes
checking for sys/mount.h... yes
checking for sys/poll.h... yes
checking for sys/resource.h... yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/statfs.h... yes
checking for sys/statvfs.h... yes
checking for sys/vfs.h... yes
checking for sys/sysexits.h... no
checking for sys/varargs.h... no
checking for sys/wait.h... yes
checking for termios.h... yes
checking for unistd.h... yes
checking for unix.h... no
checking for utime.h... yes
checking for sys/utsname.h... yes
checking for sys/ipc.h... yes
checking for dlfcn.h... yes
checking for assert.h... (cached) yes
checking for fopencookie... yes
checking for broken getcwd... no
checking for broken libc stdio... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... yes
checking for missing declarations of reentrant functions... done
checking for fclose declaration... ok
checking for tm_gmtoff in struct tm... yes
checking for struct flock... yes
checking for socklen_t... yes
checking size of intmax_t... 0
checking size of size_t... 4
checking size of ssize_t... 0
checking size of ptrdiff_t... 0
checking size of long long... 8
checking size of long long int... 8
checking size of long... 4
checking size of int... 4
checking for st_blksize in struct stat... yes
checking for st_blocks in struct stat... yes
checking for st_rdev in struct stat... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for struct sockaddr_storage... yes
checking for field sa_len in struct sockaddr... no
checking for IPv6 support... yes
checking for vprintf... yes
checking for alphasort... yes
checking for asctime_r... yes
checking for chroot... yes
checking for ctime_r... yes
checking for cuserid... yes
checking for crypt... no
checking for flock... yes
checking for ftok... yes
checking for funopen... no
checking for gai_strerror... yes
checking for gcvt... yes
checking for getloadavg... yes
checking for getlogin... yes
checking for getprotobyname... yes
checking for getprotobynumber... yes
checking for getservbyname... yes
checking for getservbyport... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for gmtime_r... yes
checking for grantpt... yes
checking for inet_ntoa... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for isascii... yes
checking for link... yes
checking for localtime_r... yes
checking for lockf... yes
checking for lchown... yes
checking for lrand48... yes
checking for memcpy... yes
checking for memmove... yes
checking for mkstemp... yes
checking for mmap... yes
checking for nl_langinfo... yes
checking for perror... yes
checking for poll... yes
checking for ptsname... yes
checking for putenv... yes
checking for realpath... yes
checking for random... yes
checking for rand_r... yes
checking for regcomp... yes
checking for res_search... (cached) yes
checking for scandir... yes
checking for setitimer... yes
checking for setlocale... yes
checking for localeconv... yes
checking for setpgid... yes
checking for setsockopt... yes
checking for setvbuf... yes
checking for shutdown... yes
checking for sin... yes
checking for snprintf... yes
checking for srand48... yes
checking for srandom... yes
checking for statfs... yes
checking for statvfs... yes
checking for std_syslog... no
checking for strcasecmp... yes
checking for strcoll... yes
checking for strdup... yes
checking for strerror... yes
checking for strftime... yes
checking for strptime... yes
checking for strstr... yes
checking for strtok_r... yes
checking for symlink... yes
checking for tempnam... yes
checking for tzset... yes
checking for unlockpt... yes
checking for unsetenv... yes
checking for usleep... yes
checking for nanosleep... yes
checking for utime... yes
checking for vsnprintf... yes
checking for getaddrinfo... yes
checking for strlcat... no
checking for strlcpy... no
checking for getopt... yes
checking whether utime accepts a null argument... yes
checking for working alloca.h... (cached) yes
checking for alloca... yes
checking for declared timezone... yes
checking for type of reentrant time-related functions... POSIX
checking for readdir_r... yes
checking for type of readdir_r... POSIX
checking for in_addr_t... yes

General settings
checking whether to include gcov symbols... no
checking whether to include debugging symbols... no
checking layout of installed files... PHP
checking path to configuration file... DEFAULT
checking where to scan for configuration files... DEFAULT
checking whether to enable safe mode by default... no
checking for safe mode exec dir... /usr/local/php/bin
checking whether to enable PHP's own SIGCHLD handler... no
checking whether to enable magic quotes by default... no
checking whether to enable runpaths... yes
checking whether to explicitly link against libgcc... no
checking whether to enable short tags by default... yes
checking whether to enable dmalloc... no
checking whether to enable IPv6 support... yes
checking how big to make fd sets... using system default
checking whether to enable versioning... no

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking for pkg-config... /usr/bin/pkg-config
checking for PCRE support... yes
checking for ZLIB support... yes
checking if the location of ZLIB install directory is defined... no
checking for gzgets in -lz... yes
checking whether to enable bc style precision math functions... no
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for CURL support... yes
checking if we should use CURL for url streams... no
checking for CURL in default path... found in /usr
checking for cURL 7.10.5 or greater... libcurl 7.10.6
checking for SSL support in libcurl... yes
checking for SSL library used... openssl
checking for openssl/crypto.h... yes
checking for curl_easy_perform in -lcurl... yes
checking for curl_version_info in -lcurl... yes
checking size of long... (cached) 4
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking whether to enable DBA... no
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable dbase support... no
checking whether to enable DOM support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable EXIF (metadata from images) support... no
checking for FrontBase SQL92 (fbsql) support... no
checking for FDF support... no
checking whether to enable the bundled filePro support... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... yes
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... yes
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
If configure fails try --with-jpeg-dir=<DIR>
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
If configure fails try --with-freetype-dir=<DIR>
checking for GNU gettext support... no
checking for GNU MP support... no
checking whether to enable hash support... yes
checking whether byte ordering is bigendian... (cached) no
checking size of short... 2
checking size of int... (cached) 4
checking size of long... (cached) 4
checking size of long long... (cached) 8
checking for hwapi support... no
checking for iconv support... yes
checking for iconv... yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... no
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for Informix support... no
checking for InterBase support... no
checking for LDAP support... no
checking for LDAP Cyrus SASL support... no
checking whether to enable multibyte string support... yes
checking whether to enable multibyte regex support... yes
checking for external libmbfl... no
checking for variable length prototypes and stdarg.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... yes
checking for unistd.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/times.h... yes
checking size of int... (cached) 4
checking size of short... (cached) 2
checking size of long... (cached) 4
checking for working const... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking for 8-bit clean memcmp... yes
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... yes
checking for MySQLi support... no
checking whether to enable embedded MySQLi support... no
checking for ncurses support... no
checking for Oracle (OCI8) support... no
checking for Adabas support... no
checking for SAP DB support... no
checking for Solid support... no
checking for IBM DB2 support... no
checking for ODBCRouter.com support... no
checking for Empress support... no
checking for Empress local access support... no
checking for Birdstep support... no
checking for a custom ODBC support... no
checking for iODBC support... no
checking for Easysoft ODBC-ODBC Bridge support... no
checking for unixODBC support... no
checking for DBMaker support... no
checking whether to enable pcntl support... no
checking whether to enable PDO support... yes
checking for PDO_DBLIB support via FreeTDS... no
checking for Firebird support for PDO... no
checking for MySQL support for PDO... no
checking Oracle OCI support for PDO... no
checking for ODBC v3 support for PDO... no
checking for PostgreSQL support for PDO... no
checking for sqlite 3 driver for PDO... yes
checking for sqlite 3 support for PDO... no
checking for PostgreSQL support... no
checking whether to enable POSIX-like functions... yes
checking for sys/mkdev.h... no
checking for seteuid... yes
checking for setegid... yes
checking for setsid... yes
checking for getsid... yes
checking for setpgid... (cached) yes
checking for getpgid... yes
checking for ctermid... yes
checking for mkfifo... yes
checking for mknod... yes
checking for getrlimit... yes
checking for getlogin... (cached) yes
checking for getgroups... yes
checking for makedev... no
checking for PSPELL support... no
checking for libedit readline replacement... no
checking for readline support... no
checking for recode support... no
checking whether to enable reflection support... yes
checking whether to enable PHP sessions... yes
checking for mm support... no
checking whether pwrite works... yes
checking whether pread works... yes
checking whether to enable shmop support... no
checking whether to enable SimpleXML support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for SNMP support... no
checking OpenSSL dir for SNMP... no
checking whether to enable UCD SNMP hack... no
checking whether to enable SOAP support... no
checking whether to enable sockets support... no
checking for socketpair... yes
checking for gethostbyname2... yes
checking enable SPL suppport... yes
checking whether zend_object_value is packed... yes
checking for sqlite support... yes
checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)... no
checking for PDO includes... checking for PDO includes... /var/service/system/
php-5.1.6/php-5.1.6/ext
checking for lemon... no
configure: warning: lemon versions supported for regeneration of libsqlite par
sers: 1.0 (found: none).
checking size of char *... 4
checking for usleep... (cached) yes
checking for nanosleep... (cached) yes
checking for time.h... yes
checking for getcwd... yes
checking for getwd... yes
checking for asinh... yes
checking for acosh... yes
checking for atanh... yes
checking for log1p... yes
checking for hypot... yes
checking for crypt in -lcrypt... yes
checking for standard DES crypt... yes
checking for extended DES crypt... no
checking for MD5 crypt... yes
checking for Blowfish crypt... no
checking whether flush should be called explicitly after a buffered io... no
checking which regex library to use... php
checking for working fnmatch... yes
checking whether rounding works as expected... no
checking for fork... yes
checking if your OS can spawn processes with inherited handles... yes
checking for glob... yes
checking for strfmon... yes
checking for nice... yes
checking for res_nmkquery... no
checking for __res_nmkquery... yes
checking for res_nsend... no
checking for __res_nsend... yes
checking for dn_expand... yes
checking for fpclass... no
checking for isinf... yes
checking for isnan... yes
checking whether atof() accepts NAN... yes
checking whether atof() accepts INF... yes
checking whether HUGE_VAL == INF... yes
checking whether HUGE_VAL + -HUGEVAL == NAN... yes
checking for wchar.h... yes
checking for mblen... yes
checking for mbrlen... yes
checking for mbsinit... yes
checking for mbstate_t... yes
checking for Sybase support... no
checking for Sybase-CT support... no
checking whether to enable System V IPC support... no
checking whether to enable System V semaphore support... no
checking whether to enable System V shared memory support... no
checking for TIDY support... no
checking whether to enable tokenizer support... yes
checking whether to enable WDDX support... no
checking whether to enable XML support... yes
checking libexpat install dir... no
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable XMLReader support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for XMLRPC-EPI support... no
checking libexpat dir for XMLRPC-EPI... no
checking iconv dir for XMLRPC-EPI... no
checking whether to enable XMLWriter support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for XSL support... no

Configuring PEAR
checking whether to install PEAR... yes

Configuring Zend
checking for bison version... (cached) 1.875 (ok)
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for limits.h... (cached) yes
checking for malloc.h... yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdarg.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for signal.h... (cached) yes
checking for unix.h... (cached) no
checking for stdlib.h... (cached) yes
checking for mach-o/dyld.h... (cached) no
checking for dlfcn.h... (cached) yes
checking for size_t... (cached) yes
checking return type of signal handlers... void
checking for uint... yes
checking for ulong... yes
checking for int32_t... yes
checking for uint32_t... yes
checking for vprintf... (cached) yes
checking for 8-bit clean memcmp... (cached) yes
checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking for memcpy... (cached) yes
checking for strdup... (cached) yes
checking for getpid... yes
checking for kill... yes
checking for strtod... yes
checking for strtol... yes
checking for finite... yes
checking for fpclass... (cached) no
checking whether sprintf is broken... no
checking for finite... (cached) yes
checking for isfinite... no
checking for isinf... (cached) yes
checking for isnan... (cached) yes
checking whether fp_except is defined... no
checking for dlfcn.h... (cached) yes
checking whether dlsym() requires a leading underscore in symbol names... no
checking virtual machine dispatch method... CALL
checking whether to enable the Zend memory manager... yes
checking whether to enable thread-safety... no
checking whether to enable inline optimization for GCC... yes
checking whether to enable a memory limit... no
checking whether to enable Zend debugging... no
checking whether to enable Zend multibyte... no
checking for inline... inline
checking target system is Darwin... no
checking for MM alignment and log values... done

Configuring TSRM
checking for stdarg.h... (cached) yes

Configuring libtool
checking build system type... i686-pc-linux-gnu
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for object suffix... o
checking for executable suffix... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool

Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
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@orpheus php-5.1.6]#
  • configureは成功した模様.
  • インストールを行う.
[root@orpheus php-5.1.6]# make install
/bin/sh /root/Download/php-5.1.6/libtool --silent --preserve-dup-deps --mode=c
ompile gcc  -Iext/libxml/ -I/root/Download/php-5.1.6/ext/libxml/ -DPHP_ATOM_IN
C -I/root/Download/php-5.1.6/include -I/root/Download/php-5.1.6/main -I/root/D
ownload/php-5.1.6 -I/usr/include/libxml2 -I/usr/kerberos/include -I/root/Downl
oad/php-5.1.6/ext/date/lib -I/usr/include/freetype1/freetype -I/root/Download/
php-5.1.6/ext/mbstring/oniguruma -I/root/Download/php-5.1.6/ext/mbstring/libmb
fl -I/root/Download/php-5.1.6/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -
I/root/Download/php-5.1.6/TSRM -I/root/Download/php-5.1.6/Zend    -I/usr/inclu
de -g -O2  -prefer-non-pic -c /root/Download/php-5.1.6/ext/libxml/libxml.c -o 
ext/libxml/libxml.lo 
/bin/sh /root/Download/php-5.1.6/libtool --silent --preserve-dup-deps --mode=c
ompile gcc  -Iext/openssl/ -I/root/Download/php-5.1.6/ext/openssl/ -DPHP_ATOM_
INC -I/root/Download/php-5.1.6/include -I/root/Download/php-5.1.6/main -I/root
/Download/php-5.1.6 -I/usr/include/libxml2 -I/usr/kerberos/include -I/root/Dow
nload/php-5.1.6/ext/date/lib -I/usr/include/freetype1/freetype -I/root/Downloa
d/php-5.1.6/ext/mbstring/oniguruma -I/root/Download/php-5.1.6/ext/mbstring/lib
mbfl -I/root/Download/php-5.1.6/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql 
-I/root/Download/php-5.1.6/TSRM -I/root/Download/php-5.1.6/Zend    -I/usr/incl
ude -g -O2  -prefer-non-pic -c /root/Download/php-5.1.6/ext/openssl/openssl.c 


〜略〜


Installing PHP SAPI module:       apache
[activating module `php5' in /usr/local/apache/conf/httpd.conf]
cp libs/libphp5.so /usr/local/apache/libexec/libphp5.so
chmod 755 /usr/local/apache/libexec/libphp5.so
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak
cp /usr/local/apache/conf/httpd.conf.new /usr/local/apache/conf/httpd.conf
rm /usr/local/apache/conf/httpd.conf.new
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/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/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.1
[PEAR] Console_Getopt - installed: 1.2
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR           - installed: 1.4.9
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
Installing PDO headers:          /usr/local/include/php/ext/pdo/
[root@orpheus php-5.1.6]# 
  • 設定ファイルを複写する.
[root@orpheus php-5.1.6]# cp php.ini-dist /usr/local/lib/php.ini
[root@orpheus php-5.1.6]#  

4.Apacheの設定

  • Apache1.3でPHP5を使うためには,Apacheの設定ファイルにモジュールや拡張子を登録する必要がある.
  • httpd.confを探す.
[root@orpheus php-5.1.6]# locate httpd.conf
/etc/httpd/conf/httpd.conf
/usr/share/redhat-config-httpd/httpd.conf.xsl
/usr/local/apache/conf/httpd.conf.default
/usr/local/apache/conf/httpd.conf
/home/root/temp/Download/apache1.3/apache_1.3.34/conf/httpd.conf-dist
/home/root/temp/Download/apache1.3/apache_1.3.34/conf/httpd.conf-dist-nw
/home/root/temp/Download/apache1.3/apache_1.3.34/conf/httpd.conf-dist-win
[root@orpheus php-5.1.6]#  
  • 下記が追加されていることを確認する.
LoadModule unique_id_module   libexec/mod_unique_id.so
LoadModule setenvif_module    libexec/mod_setenvif.so
LoadModule php5_module        libexec/libphp5.so


〜略〜


AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_php5.c
  • デフォルトページの拡張子を追加する.
<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>
  • 下記を追加する.
追加前
    #
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
追加後
    #
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps

  • Apache1.3を起動する.
[root@orpheus php-5.1.6]# /usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl stop: httpd stopped
[root@orpheus php-5.1.6]# /usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl start: httpd started
[root@orpheus php-5.1.6]# ps -ef | grep httpd
root     10495     1  0 17:49 ?        00:00:00 /usr/local/apache/bin/httpd
k2mobile 10496 10495  0 17:49 ?        00:00:00 /usr/local/apache/bin/httpd
k2mobile 10497 10495  0 17:49 ?        00:00:00 /usr/local/apache/bin/httpd
k2mobile 10498 10495  0 17:49 ?        00:00:00 /usr/local/apache/bin/httpd
k2mobile 10499 10495  0 17:49 ?        00:00:00 /usr/local/apache/bin/httpd
k2mobile 10500 10495  0 17:49 ?        00:00:00 /usr/local/apache/bin/httpd
root     10502 22423  0 17:49 pts/1    00:00:00 grep httpd
[root@orpheus php-5.1.6]#  
  • ApacheとPHP5が連携しているかを確認する.
  • 簡単なPHPプログラムを作成.
/usr/local/apache/htdocs
[root@orpheus htdocs]# cat test_phpinfo.php 
<html>
<?php
phpinfo();
?>
</html>
[root@orpheus htdocs]#  
  • Webブラウザで,作成したプログラムを呼び出すと,次のような画面が表示される.
  • 以上.

3.その他

  • PHPのバージョンアップを行った場合,以下のようなエラーが表示されてApacheの起動ができない事がある,
[root@orpheus php-5.1.6]# /usr/local/apache/bin/apachectl configtest
Syntax error on line 231 of /usr/local/apache/conf/httpd.conf:
API module structure `php5_module' in file /usr/local/apache/libexec/libphp5.so
 is garbled - perhaps this is not an Apache module DSO?
[root@orpheus php-5.1.6]#
  • このようなときには,make distcleanを実行して,コンパイルする.
[root@orpheus php-5.1.6]# make distclean
find . -name ¥*.lo -o -name ¥*.o | xargs rm -f
find . -name ¥*.la -o -name ¥*.a | xargs rm -f 
find . -name ¥*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp5.la sapi/cli/php libphp5.la modules/* libs/*
rm -f config.cache config.log config.status Makefile.objects Makefile.fragment
s libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp5.module build
mk.stamp
grep -E define'.*include/php' /var/service/system/Installbin/php-5.1.6/configu
re | /bin/sed 's/.*>//'|xargs rm -f
find . -name Makefile | xargs rm -f
[root@orpheus php-5.1.6]#
  • 以上


広告スペース
Google