PHP5.2をRedHatES3.0のApache1.3環境にインストール
0.改訂履歴
- 2006.12.12 新規作成
- 2007.10.11 誤字修正.
1.はじめに
このドキュメントでは,RedHat ES3.0 Update 8上で,Apache 1.3.37上にて,PHP5.2が利用できるようにする手順を説明する. MySQLやGD等と共に,configure中に"configure: error: libxml2 version 2.6.11 or greater required."がでてすんなりインストールできない事に対応する手順や,PHP.INIのexpose_php,mbstring,upload_max_size等についても説明する.
また,前提条件としてApache1.3.xとMySQLクライアントがインストールされている必要がある.
2.環境の確認とモジュールの入手
- 現在のOSを確認する.
[root@venus Download]# cat /etc/redhat-release Red Hat Enterprise Linux ES release 3 (Taroon Update 8) [root@venus Download]# |
- RedHat Enterprise Linux 3のアップデート8である.
- モジュールを取得する.
[root@venus Download]# wget http://jp.php.net/get/php-5.2.0.tar.gz/from/this/m irror --14:38:09-- http://jp.php.net/get/php-5.2.0.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.2.0.tar.gz [following] --14:38:09-- http://jp.php.net/distributions/php-5.2.0.tar.gz => `php-5.2.0.tar.gz' Connecting to jp.php.net[61.195.146.164]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 8,583,491 [application/x-tar] 100%[========================================================================= ========>] 8,583,491 1.56M/s ETA 00:00 14:38:16 (1.19 MB/s) - `php-5.2.0.tar.gz' saved [8,583,491/8,583,491] [root@venus Download]# |
- 取得したファイルを展開する.
[root@venus Download]# tar xfz php-5.2.0.tar.gz [root@venus Download]# cd php-5.2.0 [root@venus php-5.2.0]# |
- ファイルの中身を確認する.
[root@venus php-5.2.0]# ls CODING_STANDARDS TODO ltmain.sh CREDITS TODO-5.1 main EXTENSIONS TODO-PHP5 makedist INSTALL TSRM makerpm LICENSE UPGRADING missing Makefile.frag Zend mkinstalldirs Makefile.gcov acconfig.h netware Makefile.global acconfig.h.in pear NEWS acinclude.m4 php.gif README.CVS-RULES aclocal.m4 php.ini-dist README.EXTENSIONS build php.ini-recommended README.EXT_SKEL buildconf php5.spec.in README.PARAMETER_PARSING_API buildconf.bat regex README.PHP4-TO-PHP5-THIN-CHANGES config.guess run-tests.php README.QNX config.sub sapi README.SELF-CONTAINED-EXTENSIONS configure scripts README.STREAMS configure.in server-tests-config.php README.SUBMITTING_PATCH cvsclean server-tests.php README.TESTING cvsclean.bat snapshot README.TESTING2 ext stamp-h.in README.UNIX-BUILD-SYSTEM footer stub.c README.UPDATE_5_2 generated_lists tests README.WIN32-BUILD-SYSTEM genfiles win32 README.Zeus header README.input_filter install-sh [root@venus php-5.2.0]# |
3.configureを実行する
- 先にインストールしている,Apacheのapxsを探す.
[root@venus php-5.2.0]# locate apxs /root/Download/apache_1.3.37/htdocs/manual/programs/apxs.html /root/Download/apache_1.3.37/src/support/apxs.8 /root/Download/apache_1.3.37/src/support/apxs.pl /root/Download/apache_1.3.37/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@venus php-5.2.0]# |
- configureを実行する.
[root@venus php-5.2.0]# ./configure ¥ > --enable-mbstring ¥ > --enable-mbregex ¥ > --with-apxs=/usr/local/apache/bin/apxs ¥ > --with-gd ¥ > --with-zlib ¥ > --with-mysql ¥ > --with-ttf ¥ > --with-openssl 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 regenerate 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... no 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 sys/loadavg.h... no 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 setenv... 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@venus php-5.2.0]# |
- libxml2のバージョン2.6.11以降が必要とのこと.
- 現在のバージョンを調べる.
[root@venus php-5.2.0]# rpm -qa | grep libxml perl-libxml-enno-1.02-29 libxml2-devel-2.5.10-7 perl-libxml-perl-0.07-28 libxml2-2.5.10-7 libxml-devel-1.8.17-9.2 libxml2-python-2.5.10-7 libxml-1.8.17-9.2 [root@venus php-5.2.0]# |
- ちょっと古いようである.
4.libxmlをアップグレードする
- 新しいモジュールを入手する.
- 執筆時点での最新版は,libxml2-2.6.27であるが,glibc等のインストールし直しなどが必要となり大変そうなので,libxml2-2.6.22とした.
- 取得する為のディレクトリを作成する.(どこに作成しても良い)
[root@venus php-5.2.0]# mkdir libxml [root@venus php-5.2.0]# cd libxml [root@venus libxml]# |
- モジュールを取得する.
- まずはlibxml2本体.
root@venus libxml]# wget ftp://xmlsoft.org/libxml2/libxml2-2.6.22-1.i386.rpm --15:09:45-- ftp://xmlsoft.org/libxml2/libxml2-2.6.22-1.i386.rpm => `libxml2-2.6.22-1.i386.rpm' Resolving xmlsoft.org... 194.199.20.115 Connecting to xmlsoft.org[194.199.20.115]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /libxml2 ... done. ==> PASV ... done. ==> RETR libxml2-2.6.22-1.i386.rpm ... done. Length: 826,394 (unauthoritative) 100%[=========================================================>] 826,394 163.30K/s ETA 00:00 15:09:53 (162.98 KB/s) - `libxml2-2.6.22-1.i386.rpm' saved [826,394] [root@venus libxml]# |
- 次に,開発用ライブラリ.
[root@venus libxml]# wget ftp://xmlsoft.org/libxml2/libxml2-devel-2.6.22-1.i38 6.rpm --15:10:27-- ftp://xmlsoft.org/libxml2/libxml2-devel-2.6.22-1.i386.rpm => `libxml2-devel-2.6.22-1.i386.rpm' Resolving xmlsoft.org... 194.199.20.115 Connecting to xmlsoft.org[194.199.20.115]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /libxml2 ... done. ==> PASV ... done. ==> RETR libxml2-devel-2.6.22-1.i386.rpm ... done. Length: 2,252,938 (unauthoritative) 100%[=========================================================>] 2,252,938 206.45K/s ETA 00:00 15:10:42 (183.71 KB/s) - `libxml2-devel-2.6.22-1.i386.rpm' saved [2,252,938] [root@venus libxml]# |
- 最後に,pythonのモジュール.
[root@venus libxml]# wget ftp://xmlsoft.org/libxml2/libxml2-python-2.6.22-1.i3 86.rpm --15:11:08-- ftp://xmlsoft.org/libxml2/libxml2-python-2.6.22-1.i386.rpm => `libxml2-python-2.6.22-1.i386.rpm' Resolving xmlsoft.org... 194.199.20.115 Connecting to xmlsoft.org[194.199.20.115]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /libxml2 ... done. ==> PASV ... done. ==> RETR libxml2-python-2.6.22-1.i386.rpm ... done. Length: 724,126 (unauthoritative) 100%[=========================================================>] 724,126 153.91K/s ETA 00:00 15:11:16 (153.61 KB/s) - `libxml2-python-2.6.22-1.i386.rpm' saved [724,126] [root@venus libxml]# |
- 取得したモジュールを確認する.
[root@venus libxml]# ls -la -rw-r--r-- 1 admin users 1293941 Dec 12 15:32 libxml2-2.6.22-1.i386.rpm -rw-r--r-- 1 admin users 2137791 Dec 12 15:32 libxml2-devel-2.6.22-1.i386.rpm -rw-r--r-- 1 admin users 600111 Dec 12 15:32 libxml2-python-2.6.22-1.i386.rpm [root@venus libxml]# |
- libxmlをアップグレードする.
[root@venus libxml]# rpm -Uhv libxml2-2.6.22-1.i386.rpm warning: libxml2-2.6.22-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f error: Failed dependencies: libxml2 = 2.5.10 is needed by (installed) libxml2-python-2.5.10-7 libxml2 = 2.5.10 is needed by (installed) libxml2-devel-2.5.10-7 [root@venus libxml]# |
- pythonとdevelが必要とのこと.
- develをインストールする.
[root@venus libxml]# rpm -Uhv libxml2-devel-2.6.22-1.i386.rpm warning: libxml2-devel-2.6.22-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f error: Failed dependencies: libxml2 = 2.6.22 is needed by libxml2-devel-2.6.22-1 [root@venus libxml]# |
- develをインストールするには,libxml本体が必要とのこと.
- デッドロックしているようなので,--nodepsによって強制的にアップデートする.
[root@venus libxml]# rpm -Uhv --nodeps libxml2-devel-2.6.22-1.i386.rpm warning: libxml2-devel-2.6.22-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f Preparing... ########################################### [100%] 1:libxml2-devel ########################################### [100%] [root@venus libxml]# |
- pythonをアップグレードする.
[root@venus libxml]# rpm -Uhv libxml2-python-2.6.22-1.i386.rpm warning: libxml2-python-2.6.22-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f error: Failed dependencies: /usr/lib/python2.3 is needed by libxml2-python-2.6.22-1 libxml2 = 2.6.22 is needed by libxml2-python-2.6.22-1 [root@venus libxml]# |
- 先ほどと同じ理由でアップグレードできないので,強制的に実行する.
[root@venus libxml]# rpm -Uhv --nodeps libxml2-python-2.6.22-1.i386.rpm warning: libxml2-python-2.6.22-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f Preparing... ########################################### [100%] 1:libxml2-python ########################################### [100%] [root@venus libxml]# |
- libxml2本体をインストールする.
[root@venus libxml]# rpm -Uhv libxml2-2.6.22-1.i386.rpm warning: libxml2-2.6.22-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f Preparing... ########################################### [100%] 1:libxml2 ########################################### [100%] [root@venus libxml]# |
- すんなりインストール完了.
- インストール環境を確認する.
アップグレード前 |
---|
[root@venus php-5.2.0]# rpm -qa | grep libxml perl-libxml-enno-1.02-29 libxml2-devel-2.5.10-7 perl-libxml-perl-0.07-28 libxml2-2.5.10-7 libxml-devel-1.8.17-9.2 libxml2-python-2.5.10-7 libxml-1.8.17-9.2 [root@venus php-5.2.0]# |
アップグレード後 |
[root@venus libxml]# rpm -qa | grep libxml perl-libxml-enno-1.02-29 libxml2-2.6.22-1 perl-libxml-perl-0.07-28 libxml2-python-2.6.22-1 libxml2-devel-2.6.22-1 libxml-devel-1.8.17-9.2 libxml-1.8.17-9.2 [root@venus libxml]# |
- アップデートされていることが確認できた.
5.configureを再実行する
- 途中になっているキャッシュファイルを削除する.(おまじない)
[root@venus libxml]# cd .. [root@venus php-5.2.0]# rm config.cache rm: remove regular empty file `config.cache'? y [root@venus php-5.2.0]# |
- configureを再実行する.
[root@venus php-5.2.0]# ./configure --enable-mbstring --enable-mbregex --with -apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib --with-mysql --with-ttf --with-openssl 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... no 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 sys/loadavg.h... no 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 setenv... 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... no checking if we should use cURL for url streams... no 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 input filter support... yes checking pcre install prefix... 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... /usr 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... /usr 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 checking for jpeg_read_header in -ljpeg... yes checking for png_write_image in -lpng... yes If configure fails try --with-xpm-dir=<DIR> checking for FreeType 1 support... no - FreeType 2.x is to be used instead 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 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 whether to enable JavaScript Object Serialization support... yes checking for ANSI C header files... (cached) yes 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 whether to check multibyte regex backtrack... 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... /var/lib/mysql/mysql.sock 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 checking PHP version... 5.2.0, ok 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 support for PDO... yes checking for PDO includes... checking for PDO includes... /root/Download/php-5. 2.0/ext checking size of char *... 4 checking for usleep... (cached) yes checking for nanosleep... (cached) yes checking for time.h... yes checking for fdatasync in -lrt... yes 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 initgroups... yes 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... (cached) /root/Download/php-5.2.0/ext checking for lemon... no configure: warning: lemon versions supported for regeneration of libsqlite par sers: 1.0 (found: none). checking size of char *... (cached) 4 checking for usleep... (cached) yes checking for nanosleep... (cached) yes checking for time.h... (cached) 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 whether strptime() declaration fails... no 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 libexpat dir for WDDX... 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 checking for zip archive read/writesupport... 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 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 checking for memory allocation using mmap(MAP_ANON)... yes checking for memory allocation using mmap(/dev/zero)... yes checking for mremap... yes 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 for c++... c++ checking whether the C++ compiler (c++ ) works... yes checking whether the C++ compiler (c++ ) is a cross-compiler... no checking whether we are using GNU C++... yes checking whether c++ accepts -g... yes checking how to run the C++ preprocessor... c++ -E 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 checking for ld used by c++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes checking for c++ option to produce PIC... -fPIC checking if c++ PIC flag -fPIC works... yes checking if c++ supports -c -o file.o... yes checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes 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@venus php-5.2.0]# |
- configureが成功した.
- 次に,コンパイルとインストールを行う.
[root@venus php-5.2.0]# make install /bin/sh /root/Download/php-5.2.0/libtool --silent --preserve-dup-deps --mode=c ompile gcc -Iext/libxml/ -I/root/Download/php-5.2.0/ext/libxml/ -DPHP_ATOM_IN C -I/root/Download/php-5.2.0/include -I/root/Download/php-5.2.0/main -I/root/D ownload/php-5.2.0 -I/usr/include/libxml2 -I/usr/kerberos/include -I/root/Downl oad/php-5.2.0/ext/date/lib -I/usr/include/freetype2 -I/root/Download/php-5.2.0 /ext/mbstring/oniguruma -I/root/Download/php-5.2.0/ext/mbstring/libmbfl -I/roo t/Download/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/root/Do wnload/php-5.2.0/TSRM -I/root/Download/php-5.2.0/Zend -I/usr/include -g -O2 -prefer-non-pic -c /root/Download/php-5.2.0/ext/libxml/libxml.c -o ext/libxml/ libxml.lo /bin/sh /root/Download/php-5.2.0/libtool --silent --preserve-dup-deps --mode=c ompile gcc -Iext/openssl/ -I/root/Download/php-5.2.0/ext/openssl/ -DPHP_ATOM_ INC -I/root/Download/php-5.2.0/include -I/root/Download/php-5.2.0/main -I/root /Download/php-5.2.0 -I/usr/include/libxml2 -I/usr/kerberos/include -I/root/Dow nload/php-5.2.0/ext/date/lib -I/usr/include/freetype2 -I/root/Download/php-5.2. 0/ext/mbstring/oniguruma -I/root/Download/php-5.2.0/ext/mbstring/libmbfl -I/ro ot/Download/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/root/D ownload/php-5.2.0/TSRM -I/root/Download/php-5.2.0/Zend -I/usr/include -g -O 2 -prefer-non-pic -c /root/Download/php-5.2.0/ext/openssl/openssl.c -o ext/op enssl/openssl.lo 〜略〜 Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zen d/zend_mm.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cli/php_cl i.lo sapi/cli/php_cli_readline.lo sapi/cli/getopt.lo main/internal_functions_c li.lo -lcrypt -lcrypt -lrt -lmysqlclient -lfreetype -lpng -lz -ljpeg -lz -lres olv -lm -ldl -lnsl -lxml2 -lz -lm -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_er r -lk5crypto -lresolv -ldl -lz -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -l z -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -o sapi/cli/php 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.11 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@venus php-5.2.0]# |
- PHPのコマンドインタプリタを実行してバージョンを確認する.
[root@venus php-5.2.0]# ls -la /usr/local/bin/php -rwxr-xr-x 1 root root 11818249 Dec 12 16:31 /usr/local/bin/php [root@venus php-5.2.0]# /usr/local/bin/php -v PHP 5.2.0 (cli) (built: Dec 12 2006 16:31:43) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies [root@venus php-5.2.0]# |
- これで,インストール作業は終了.
6.PHP.INIの設定
- PHP.INIの細かい設定を行う.
- 設定ファイルを複写する.
[root@venus php-5.2.0]# cp php.ini-dist /usr/local/lib/php.ini [root@venus php-5.2.0]# |
- ファイルのアップロードサイズを変更する.
- デフォルトでは,2MBのファイル制限がある.
;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ;upload_tmp_dir = ; Maximum allowed size for uploaded files. upload_max_filesize = 2M |
- upload_max_filesizeを変更することによって,アップロードするファイルサイズを変更できる.
- ちなみに,画素数からファイルサイズを調べると,次の通り.
縦
|
横
|
ドット数
|
万画素
|
MB
|
|
sQCIF |
128
|
96
|
12288
|
1.23
|
0.05
|
QCIF |
176
|
144
|
25344
|
2.53
|
0.10
|
QVGA |
320
|
240
|
76800
|
7.68
|
0.29
|
CIF |
352
|
288
|
101376
|
10.14
|
0.39
|
VGA |
640
|
480
|
307200
|
30.72
|
1.17
|
SVGA |
800
|
600
|
480000
|
48.00
|
1.83
|
XGA |
1024
|
768
|
786432
|
78.64
|
3.00
|
SXGA |
1280
|
960
|
1228800
|
122.88
|
4.69
|
SXGA+ |
1400
|
1050
|
1470000
|
147.00
|
5.61
|
UXGA |
1600
|
1200
|
1920000
|
192.00
|
7.32
|
QXGA |
2048
|
1536
|
3145728
|
314.57
|
12.00
|
350万画素 |
2304
|
1536
|
3538944
|
353.89
|
13.50
|
450万画素 |
2592
|
1728
|
4478976
|
447.90
|
17.09
|
500万画素 |
2592
|
1944
|
5038848
|
503.88
|
19.22
|
600万画素 |
2848
|
2136
|
6083328
|
608.33
|
23.21
|
600万画素ワイド |
3024
|
2016
|
6096384
|
609.64
|
23.26
|
QUXGA |
3200
|
2400
|
7680000
|
768.00
|
29.30
|
QUXGA Wide |
3840
|
2400
|
9216000
|
921.60
|
35.16
|
1230万画素 |
4256
|
2848
|
12121088
|
1212.11
|
46.24
|
- 関連するパラメータで,post_max_size(8M)とmemory_limit(16)がある.
- memory_limit >= post_max_size >= upload_max_filesizeと,なっている必要がある.
- 次に,日本語について設定を行う.
変更前 |
---|
[mbstring] ; language for internal character representation. ;mbstring.language = Japanese ; internal/script encoding. ; Some encoding cannot work as internal encoding. ; (e.g. SJIS, BIG5, ISO-2022-*) ;mbstring.internal_encoding = EUC-JP ; http input encoding. ;mbstring.http_input = auto ; http output encoding. mb_output_handler must be ; registered as output buffer to function ;mbstring.http_output = SJIS ; enable automatic encoding translation according to ; mbstring.internal_encoding setting. Input chars are ; converted to internal encoding by setting this to On. ; Note: Do _not_ use automatic encoding translation for ; portable libs/applications. ;mbstring.encoding_translation = Off ; automatic encoding detection order. ; auto means ;mbstring.detect_order = auto |
変更後 |
[mbstring] ; language for internal character representation. ;mbstring.language = Japanese mbstring.language = Japanese ; internal/script encoding. ; Some encoding cannot work as internal encoding. ; (e.g. SJIS, BIG5, ISO-2022-*) ;mbstring.internal_encoding = EUC-JP mbstring.internal_encoding = EUC-JP ; http input encoding. ;mbstring.http_input = auto mbstring.http_input = SJIS ; http output encoding. mb_output_handler must be ; registered as output buffer to function ;mbstring.http_output = SJIS mbstring.http_output = SJIS ; enable automatic encoding translation according to ; mbstring.internal_encoding setting. Input chars are ; converted to internal encoding by setting this to On. ; Note: Do _not_ use automatic encoding translation for ; portable libs/applications. ;mbstring.encoding_translation = Off ; automatic encoding detection order. ; auto means ;mbstring.detect_order = auto |
- システム上,SJISを利用する場合でも,PHPの内部エンコーディング(internal_encoding)でSJISは未対応のため,EUC-JPを設定する.
- 次に,PHPのバナーを表示させないように設定する.
変更前 ; ; Misc ; ; Decides whether PHP may expose the fact that it is installed on the server ; (e.g. by adding its signature to the Web server header). It is no security ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. expose_php = On
変更後 ; ; Misc ; ; Decides whether PHP may expose the fact that it is installed on the server ; (e.g. by adding its signature to the Web server header). It is no security ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. ;expose_php = On expose_php = Off
- 変更前と後の,ヘッダを確認する.
変更前 [root@venus php-5.2.0]# curl -I http://localhost HTTP/1.1 200 OK Date: Tue, 12 Dec 2006 09:22:21 GMT Server: Apache/1.3.37 (Unix) PHP/5.2.0 Content-Location: index.html.ja.jis Vary: negotiate,accept-language,accept-charset TCN: choice Last-Modified: Thu, 06 Jan 2005 12:11:39 GMT ETag: "4d0089-707-41dd2afb;457d40bc" Accept-Ranges: bytes Content-Length: 1799 Content-Type: text/html; charset=iso-2022-jp Content-Language: ja [root@venus php-5.2.0]#
変更後 [root@venus php-5.2.0]# /usr/local/apache/bin/apachectl stop /usr/local/apache/bin/apachectl stop: httpd stopped [root@venus php-5.2.0]# /usr/local/apache/bin/apachectl start /usr/local/apache/bin/apachectl start: httpd started [root@venus php-5.2.0]# curl -I http://localhost HTTP/1.1 200 OK Date: Tue, 12 Dec 2006 09:23:12 GMT Server: Apache/1.3.37 (Unix) Content-Location: index.html.ja.jis Vary: negotiate,accept-language,accept-charset TCN: choice Last-Modified: Thu, 06 Jan 2005 12:11:39 GMT ETag: "4d0089-707-41dd2afb;457d40bc" Accept-Ranges: bytes Content-Length: 1799 Content-Type: text/html; charset=iso-2022-jp Content-Language: ja [root@venus php-5.2.0]#
- ヘッダが出なくなったことが確認できた.
7.Apacheの設定
- 次に,Apacheの設定を行う.
- httpd.confファイルを探す.
[root@venus php-5.2.0]# locate httpd.conf /root/Download/apache_1.3.37/conf/httpd.conf-dist-win /root/Download/apache_1.3.37/conf/httpd.conf-dist-nw /root/Download/apache_1.3.37/conf/httpd.conf-dist /usr/local/apache/conf/httpd.conf.default /usr/local/apache/conf/httpd.conf [root@venus php-5.2.0]# |
- /usr/local/apache/conf/httpd.confファイルを変更する.
- LanguagePriorityで,日本(ja)を先頭に編集する.
変更前 |
---|
# LanguagePriority allows you to give precedence to some languages # in case of a tie during content negotiation. # # Just list the languages in decreasing order of preference. We have # more or less alphabetized them here. You probably want to change this. # <IfModule mod_negotiation.c> LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw </IfModule> |
変更後 |
# LanguagePriority allows you to give precedence to some languages # in case of a tie during content negotiation. # # Just list the languages in decreasing order of preference. We have # more or less alphabetized them here. You probably want to change this. # <IfModule mod_negotiation.c> LanguagePriority ja en da nl et fr de el it kr no pl pt pt-br ru ltz ca es sv tw </IfModule> |
- PHPがLoadmoduleとして設定されているか確認する.
- この記述は,PHPのインストーラが自動的に行っている.
LoadModule unique_id_module libexec/mod_unique_id.so LoadModule setenvif_module libexec/mod_setenvif.so LoadModule php5_module libexec/libphp5.so # Reconstruction of the complete module list from all available modules # (static and shared ones) to achieve correct module execution order. |
- AddModuleで追加されているか,確認する.
AddModule mod_unique_id.c AddModule mod_so.c AddModule mod_setenvif.c AddModule mod_php5.c # # ExtendedStatus controls whether Apache will generate "full" status |
- 次に,デフォルトのページ呼び出しを設定するため,DirectoryIndexに,index.phpを登録する.
変更前 |
---|
# # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. # <IfModule mod_dir.c> DirectoryIndex index.html </IfModule> |
変更後 |
# # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. # <IfModule mod_dir.c> DirectoryIndex index.php index.html </IfModule> |
- AddTypeにて,.php拡張子のアプリケーションタイプを設定する.
変更前 |
---|
# # 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 # # AddEncoding allows you to have certain browsers uncompress |
変更後 |
# # 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 # # AddEncoding allows you to have certain browsers uncompress |
- コンフィグレーションのテストを行い,サーバを実行する.
[root@venus php-5.2.0]# /usr/local/apache/bin/apachectl configtest Syntax OK [root@venus php-5.2.0]# /usr/local/apache/bin/apachectl stop /usr/local/apache/bin/apachectl stop: httpd stopped [root@venus php-5.2.0]# /usr/local/apache/bin/apachectl start /usr/local/apache/bin/apachectl start: httpd started [root@venus php-5.2.0]# ps -ef | grep httpd root 570 1 1 19:21 ? 00:00:00 /usr/local/apache/bin/httpd nobody 571 570 0 19:21 ? 00:00:00 /usr/local/apache/bin/httpd nobody 572 570 0 19:21 ? 00:00:00 /usr/local/apache/bin/httpd nobody 573 570 0 19:21 ? 00:00:00 /usr/local/apache/bin/httpd nobody 574 570 0 19:21 ? 00:00:00 /usr/local/apache/bin/httpd nobody 575 570 0 19:21 ? 00:00:00 /usr/local/apache/bin/httpd root 577 13761 0 19:21 pts/0 00:00:00 grep httpd [root@venus php-5.2.0]# |
8.MySQLへの接続確認
- PHPからMySQLへ接続できるか,確認する.
- 次のようなスクリプトを作成する.
[root@venus php-5.2.0]# cat dbconnect.php <?php $link = mysql_connect("localhost", "root", "password") or die("Could not connect"); print ("Connected successfully¥n"); mysql_close($link); ?> [root@venus php-5.2.0]# |
- コマンドラインから実行する.
[root@venus php-5.2.0]# /usr/local/bin/php dbconnect.php Connected successfully [root@venus php-5.2.0]# |
- これで完了.