Mac OS X に Apache の PHP4 modules を入れる pkgsrc を使う。 !! ref pkgsrc /php http://www.fujiwara.jp/software/pkgsrc/php.html !! apache2 www/apache2 を入れておく。 !! Makefile あらかじめ www/php4/Makefile.php に以下を追加しておく。 CONFIGURE_ARGS+= --enable-i18n --enable-mbstring --enable-mbstr-enc-trans www/php4 と www/ap-php を make する。 www/ap-php を make すれば php4 も入ってるか? rin@kahori[/usr/pkgsrc/www/ap-php]% sudo bmake install clean ===> Checking for vulnerabilities in ap-php-4.4.1nb4 => php-4.4.1.tar.bz2 doesn't seem to exist on this system. => Attempting to fetch php-4.4.1.tar.bz2 from http://www.php.net/distributions/. => [4157749 bytes] Requesting http://www.php.net/distributions/php-4.4.1.tar.bz2 Redirected to http://static.php.net/www.php.net/distributions/php-4.4.1.tar.bz2 Requesting http://static.php.net/www.php.net/distributions/php-4.4.1.tar.bz2 4157749 bytes retrieved in 00:28 (144.87 KB/s) => Checksum SHA1 OK for php-4.4.1.tar.bz2. => Checksum RMD160 OK for php-4.4.1.tar.bz2. ===> Extracting for ap-php-4.4.1nb4 ========================================================================== The supported build options for this package are: inet6 ssl The currently selected options are: inet6 ssl You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.ap-php (not defined) Deprecated variable USE_INET6 set to YES, use PKG_DEFAULT_OPTIONS+=inet6 instead. ========================================================================== ========================================================================== The following variables will affect the build process of this package, ap-php-4.4.1nb4. Their current value is shown below: * PKG_APACHE = apache2 * SSLBASE (defined) * USE_INET6 = YES You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Required package php-4.4.*: NOT found ===> Verifying reinstall for ../../www/php4 ===> Checking for vulnerabilities in php-4.4.1nb2 => Checksum SHA1 OK for php-4.4.1.tar.bz2. => Checksum RMD160 OK for php-4.4.1.tar.bz2. ===> Extracting for php-4.4.1nb2 ========================================================================== The supported build options for this package are: cgi fastcgi inet6 ssl The currently selected options are: cgi inet6 ssl You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.php (not defined) Deprecated variable USE_INET6 set to YES, use PKG_DEFAULT_OPTIONS+=inet6 instead. ========================================================================== ========================================================================== The following variables will affect the build process of this package, php-4.4.1nb2. Their current value is shown below: * SSLBASE (defined) * USE_INET6 = YES You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Required installed package libtool-base>=1.5.18nb5: libtool-base-1.5.18nb5 found ===> Patching for php-4.4.1nb2 ===> Applying pkgsrc patches for php-4.4.1nb2 ===> Overriding tools for php-4.4.1nb2 ===> Creating toolchain wrappers for php-4.4.1nb2 ===> Configuring for php-4.4.1nb2 | the installation process at this point. | +--------------------------------------------------------------------+ | *** NOTE *** | | The default for register_globals is now OFF! | | | | If your application relies on register_globals being ON, you | | should explicitly set it to on in your php.ini file. | | Note that you are strongly encouraged to read | | http://www.php.net/manual/en/security.globals.php | | about the implications of having register_globals set to on, and | | avoid using it if possible. | +--------------------------------------------------------------------+ Thank you for using PHP. ===> Building for php-4.4.1nb2 cd /usr/pkgsrc/textproc/expat; sudo bmake update Build complete. (It is safe to ignore warnings about tempnam and tmpnam). => Unwrapping files-to-be-installed. ===> Installing for php-4.4.1nb2 Installing PHP SAPI module: cgi Installing PHP CGI into: /Volumes/NetBSD/pkg/bin/ Installing PEAR environment: /Volumes/NetBSD/pkg/lib/php/ [PEAR] Archive_Tar - installed: 1.1 [PEAR] Console_Getopt - installed: 1.2 [PEAR] PEAR - installed: 1.3.6 Wrote PEAR system config file at: /Volumes/NetBSD/pkg/etc/pear.conf You may want to add: /Volumes/NetBSD/pkg/lib/php to your php.ini include_path [PEAR] HTML_Template_IT- installed: 1.1 [PEAR] Net_UserAgent_Detect- installed: 2.0.1 [PEAR] XML_RPC - installed: 1.4.0 Installing build environment: /Volumes/NetBSD/pkg/lib/php/build/ Installing header files: /Volumes/NetBSD/pkg/include/php/ Installing helper programs: /Volumes/NetBSD/pkg/bin/ program: phpize program: php-config Installing man pages: /Volumes/NetBSD/pkg/man/man1/ page: phpize.1 page: php-config.1 /usr/bin/install -c -s -o root -g wheel -m 555 /Volumes/NetBSD/pkgsrc/www/php4/work/php-4.4.1/sapi/cli/php /Volumes/NetBSD/pkg/bin/php /usr/bin/install -c -o root -g wheel -m 444 /Volumes/NetBSD/pkgsrc/www/php4/work/php-4.4.1/sapi/cli/php.1 /Volumes/NetBSD/pkg/man/man1/php.1 /usr/bin/install -d -o root -g wheel -m 755 /Volumes/NetBSD/pkg/libexec/cgi-bin /usr/bin/install -c -s -o root -g wheel -m 555 /Volumes/NetBSD/pkgsrc/www/php4/work/php-4.4.1/sapi/cgi/php /Volumes/NetBSD/pkg/libexec/cgi-bin /usr/bin/install -d -o root -g wheel -m 755 /Volumes/NetBSD/pkg/share/examples/php cd /Volumes/NetBSD/pkgsrc/www/php4/work/php-4.4.1; /usr/bin/install -c -o root -g wheel -m 444 php.ini-dist php.ini-recommended /Volumes/NetBSD/pkg/share/examples/php /usr/bin/install -d -o root -g wheel -m 755 /Volumes/NetBSD/pkg/share/php /usr/bin/install -c -o root -g wheel -m 444 /Volumes/NetBSD/pkgsrc/www/php4/work/php-4.4.1/php.gif /Volumes/NetBSD/pkg/share/php ===> [Automatic manual page handling] =========================================================================== Installing files needed by php-4.4.1nb2: /Volumes/NetBSD/pkg/etc/php.ini [/Volumes/NetBSD/pkg/share/examples/php/php.ini-recommended] =========================================================================== ===> Please note the following: =========================================================================== $NetBSD: MESSAGE,v 1.10 2005/10/08 16:51:50 jdolecek Exp $ To process PHP scripts, you will need a PHP-enabled HTTP server. You may either configure the HTTP server to use PHP as a CGI program, or install a PHP module for your HTTP server, e.g. ap-php. Some additional packages you may wish to install are: php-dba DBM database access php-iconv character set conversion Note that php4-pcre, php4-session and php4-xml are no longer separate packages since 4.3.3, the main PHP4 package has them built-in now. Note php-openssl has been removed as separate package as of 4.4.0nb2, the main PHP4 package has it built-in now. =========================================================================== ===> Registering installation for php-4.4.1nb2 ===> Returning to build of ap-php-4.4.1nb4 ===> Required installed package php>=4.4.0: php-4.4.1nb2 found ===> Required package apache>=2.0.55nb6: NOT found ===> Verifying reinstall for ../../www/apache2 ===> Checking for vulnerabilities in apache-2.0.55nb6 => Checksum SHA1 OK for httpd-2.0.55.tar.bz2. => Checksum RMD160 OK for httpd-2.0.55.tar.bz2. ===> Extracting for apache-2.0.55nb6 ========================================================================== The supported build options for this package are: suexec You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.apache (not defined) ========================================================================== ========================================================================== The following variables will affect the build process of this package, apache-2.0.55nb6. Their current value is shown below: * APACHE_MODULES = all proxy proxy_connect proxy_ftp proxy_http ssl deflate * APACHE_MPM = prefork * SSLBASE (defined) * USE_INET6 = YES You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Required installed package user>=20040801: user-20040801 found ===> Required installed package perl>=5.8.0: perl-5.8.7nb7 found ===> Required package apr>=0.9.7.2.0.55nb1: NOT found ===> Verifying reinstall for ../../devel/apr ===> Checking for vulnerabilities in apr-0.9.7.2.0.55nb1 => Checksum SHA1 OK for httpd-2.0.55.tar.bz2. => Checksum RMD160 OK for httpd-2.0.55.tar.bz2. ===> Extracting for apr-0.9.7.2.0.55nb1 ========================================================================== The supported build options for this package are: db4 ldap You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.apr (not defined) ========================================================================== ===> Required package expat>=2.0.0: NOT found ===> Installing for expat-2.0.0 ===> expat-1.95.8nb2 is already installed - perhaps an older version? *** If so, you may use either of: *** - "pkg_delete expat-1.95.8nb2" and "/usr/pkg/bin/bmake reinstall" to upgrade properly *** - "/usr/pkg/bin/bmake update" to rebuild the package and all of its dependencies *** - "/usr/pkg/bin/bmake replace" to replace only the package without re-linking *** dependencies, risking various problems. *** Error code 1 rin@kahori[/usr/pkgsrc/www/ap-php]% cd /usr/pkgsrc/textproc/expat; sudo bmake update =========================================================================== The following users are no longer being used by apache-2.0.55nb4, and they can be removed if no other packages are using them: www =========================================================================== =========================================================================== The following groups are no longer being used by apache-2.0.55nb4, and they can be removed if no other packages are using them: www =========================================================================== =========================================================================== The following files are no longer being used by apache-2.0.55nb4, and they can be removed if no other packages are using them: /Volumes/NetBSD/pkg/etc/httpd/httpd.conf =========================================================================== =========================================================================== The following directories are no longer being used by apache-2.0.55nb4, and they can be removed if no other packages are using them: /var/log/httpd =========================================================================== ===> Checking for vulnerabilities in expat-2.0.0 ===> Installing for expat-2.0.0 /bin/sh ./conftools/mkinstalldirs /Volumes/NetBSD/pkg/lib /Volumes/NetBSD/pkg/include /bin/sh ./libtool --mode=install /usr/bin/install -c -o root -g wheel libexpat.la /Volumes/NetBSD/pkg/lib/libexpat.la /usr/bin/install -c -o root -g wheel .libs/libexpat.1.5.0.dylib /Volumes/NetBSD/pkg/lib/libexpat.1.5.0.dylib (cd /Volumes/NetBSD/pkg/lib && rm -f libexpat.1.dylib && ln -s libexpat.1.5.0.dylib libexpat.1.dylib) (cd /Volumes/NetBSD/pkg/lib && rm -f libexpat.dylib && ln -s libexpat.1.5.0.dylib libexpat.dylib) /usr/bin/install -c -o root -g wheel .libs/libexpat.lai /Volumes/NetBSD/pkg/lib/libexpat.la /usr/bin/install -c -o root -g wheel .libs/libexpat.a /Volumes/NetBSD/pkg/lib/libexpat.a ranlib /Volumes/NetBSD/pkg/lib/libexpat.a chmod 644 /Volumes/NetBSD/pkg/lib/libexpat.a ---------------------------------------------------------------------- Libraries have been installed in: /Volumes/NetBSD/pkg/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable during execution See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- ===> Extracting for apr-0.9.7.2.0.55nb1 ========================================================================== The supported build options for this package are: db4 ldap You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.apr (not defined) ========================================================================== ===> Extracting for apache-2.0.55nb6 ========================================================================== The supported build options for this package are: suexec You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.apache (not defined) ========================================================================== ===> [Automatic manual page handling] =========================================================================== Installing files needed by apache-2.0.55nb6: /Volumes/NetBSD/pkg/etc/httpd/httpd.conf already exists. /Volumes/NetBSD/pkg/etc/httpd/magic [/Volumes/NetBSD/pkg/share/examples/httpd/magic] /Volumes/NetBSD/pkg/etc/httpd/mime.types [/Volumes/NetBSD/pkg/share/examples/httpd/mime.types] /Volumes/NetBSD/pkg/etc/httpd/ssl.conf [/Volumes/NetBSD/pkg/share/examples/httpd/ssl-std.conf] /Volumes/NetBSD/pkg/sbin/envvars [/Volumes/NetBSD/pkg/sbin/envvars-std] =========================================================================== =========================================================================== The following files should be created for apache-2.0.55nb6: /etc/rc.d/apache (m=0755) [/Volumes/NetBSD/pkg/share/examples/rc.d/apache] =========================================================================== ===> Registering installation for apache-2.0.55nb6 ===> Extracting for neon-0.25.5nb1 ========================================================================== The following variables will affect the build process of this package, neon-0.25.5nb1. Their current value is shown below: * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Extracting for subversion-base-1.3.0nb1 ========================================================================== The following variables will affect the build process of this package, subversion-base-1.3.0nb1. Their current value is shown below: * PKG_BUILD_OPTIONS.apr (defined) * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== checking for static Apache module support... checking for Apache module support via DSO through APXS... no ================================================================== WARNING: skipping the build of mod_dav_svn --with-apxs or --with-apache must be used ================================================================== ===> Extracting for ap2-subversion-1.3.0nb1 ========================================================================== The following variables will affect the build process of this package, ap2-subversion-1.3.0nb1. Their current value is shown below: * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ---------------------------------------------------------------------- Libraries have been installed in: /Volumes/NetBSD/pkg/lib/httpd If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable during execution See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- chmod 755 /Volumes/NetBSD/pkg/lib/httpd/mod_authz_svn.so ===> [Automatic manual page handling] ===> Please note the following: =========================================================================== $NetBSD: MESSAGE,v 1.2 2003/05/25 09:17:41 epg Exp $ See /Volumes/NetBSD/pkg/share/doc/subversion/INSTALL for details on making a repository accessible via mod_dav_svn. Basically, you need something like this in httpd.conf: LoadModule dav_svn_module "lib/httpd/mod_dav_svn.so" DAV svn SVNPath "/path/to/repository" AuthType Basic AuthName "Subversion repository" AuthUserFile "/path/to/passwd-file" Require valid-user =========================================================================== ===> Registering installation for ap2-subversion-1.3.0nb1 ===> Extracting for p5-subversion-1.3.0nb1 ========================================================================== The following variables will affect the build process of this package, p5-subversion-1.3.0nb1. Their current value is shown below: * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ================================================================== WARNING: skipping the build of mod_dav_svn --with-apxs or --with-apache must be used ================================================================== ===> Extracting for py23-subversion-1.3.0nb1 ========================================================================== The following variables will affect the build process of this package, py23-subversion-1.3.0nb1. Their current value is shown below: * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Extracting for ruby18-subversion-1.3.0nb2 ========================================================================== The following variables will affect the build process of this package, ruby18-subversion-1.3.0nb2. Their current value is shown below: * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Extracting for ruby18-base-1.8.4 ========================================================================== The following variables will affect the build process of this package, ruby18-base-1.8.4. Their current value is shown below: * SSLBASE (defined) You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== =========================================================================== $NetBSD: MESSAGE,v 1.4 2006/01/03 14:37:24 taca Exp $ Note that this is a minimal package. The original Ruby 1.8.4 distribution includes more extension libraries, some of which are provided as separate packages: converters/ruby-iconv: Iconv module databases/ruby-gdbm: GDBM module devel/ruby-curses: Curses module devel/ruby-readline: readline module x11/ruby-tk: Tk modules =========================================================================== =========================================================================== $NetBSD: MESSAGE,v 1.2 2001/11/11 06:17:27 hubertf Exp $ This package doesn't contain any manuals nor examples, but it wouldn't be a problem, as the interface of this module is exactly the same as DBM and SDBM, except GDBM has a "reorganize" method. See the DBM module's document included in the ruby-man package, and gdbm(3) manpage included in the gdbm package. =========================================================================== ===> Registering installation for ruby18-gdbm-1.8.4 ===> Cleaning for fontconfig-2.3.2nb1 ===> Cleaning for xorg-libs-6.9.0nb1 ===> Cleaning for neon-0.25.5nb1 ===> Cleaning for apr-0.9.7.2.0.55nb1 ===> Cleaning for subversion-base-1.3.0nb1 ===> Cleaning for ruby18-subversion-1.3.0nb2 ===> Cleaning for py23-subversion-1.3.0nb1 ===> Cleaning for p5-subversion-1.3.0nb1 ===> Cleaning for apache-2.0.55nb6 ===> Cleaning for ap2-subversion-1.3.0nb1 ===> Cleaning for subversion-1.3.0nb1 ===> Cleaning for expat-2.0.0 !! ap-php rin@kahori[/usr/pkgsrc/textproc/expat]% cd /usr/pkgsrc/www/ap-php rin@kahori[/usr/pkgsrc/www/ap-php]% sudo bmake install clean ===> Checking for vulnerabilities in ap-php-4.4.1nb4 06021702.jpg=> Checksum SHA1 OK for php-4.4.1.tar.bz2. => Checksum RMD160 OK for php-4.4.1.tar.bz2. ===> Extracting for ap-php-4.4.1nb4 ========================================================================== The supported build options for this package are: inet6 ssl The currently selected options are: inet6 ssl You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.ap-php (not defined) Deprecated variable USE_INET6 set to YES, use PKG_DEFAULT_OPTIONS+=inet6 instead. ========================================================================== =========================================================================== $NetBSD: MESSAGE,v 1.2 2005/03/30 03:25:00 darcy Exp $ In order to use this module in your Apache 1.x installation, you need to add the following to your httpd.conf file: LoadModule php4_module lib/httpd/mod_php4.so AddType application/x-httpd-php .php You may also add following if you still use .php3 files: AddType application/x-httpd-php .php3 For Apache 2.x installation, you need following: LoadModule php4_module lib/httpd/mod_php4.so AddHandler application/x-httpd-php .php You may also add following if you still use .php3 files: AddHandler application/x-httpd-phpp .php3 =========================================================================== ===> Registering installation for ap-php-4.4.1nb4 ap-php-4.4.1nb4 requires installed package apache-2.0.55nb6 ap-php-4.4.1nb4 requires installed package php-4.4.1nb2 ===> Cleaning for ap-php-4.4.1nb4 !! segv php が落ちる。 [Fri Feb 17 13:23:53 2006] [notice] child pid 26858 exit signal Bus error (10) [Fri Feb 17 13:23:55 2006] [notice] child pid 26859 exit signal Bus error (10) [Fri Feb 17 13:23:56 2006] [notice] child pid 26865 exit signal Bus error (10) [Fri Feb 17 13:23:58 2006] [notice] child pid 26868 exit signal Bus error (10) !! 解決 httpd.conf に AddType を書いてなかった。 AddType application/x-httpd-php .php !! httpd.conf 以下を書いておく。 LoadModule php4_module lib/httpd/mod_php4.so AddHandler application/x-httpd-php .php AddType application/x-httpd-php .php !! php.ini /usr/pkg/etc/php.ini に以下を書いておく。 % diff -u /usr/pkg/share/examples/php/php.ini-recommended /usr/pkg/etc/php.ini --- /usr/pkg/share/examples/php/php.ini-recommended Tue Feb 21 19:34:37 2006 +++ /usr/pkg/etc/php.ini Tue Feb 21 22:10:45 2006 @@ -72,6 +72,7 @@ ; when calling a function. The PHP 4 style to do this is by making the ; function require the relevant argument by reference. +zend_extension_ts = /Users/rin/public_html/fr/ioncube/ioncube_loader_dar_4.4_ts.so ;;;;;;;;;;;;;;;;;;;; ; Language Options ; @@ -1038,19 +1039,19 @@ [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 = auto ; http output encoding. mb_output_handler must be ; registered as output buffer to function -;mbstring.http_output = SJIS +mbstring.http_output = EUC-JP ; enable automatic encoding translation accoding to ; mbstring.internal_encoding setting. Input chars are @@ -1061,11 +1062,11 @@ ; automatic encoding detection order. ; auto means -;mbstring.detect_order = auto +mbstring.detect_order = auto ; substitute_character used when character cannot be converted ; one from another -;mbstring.substitute_character = none; +mbstring.substitute_character = none; ; overload(replace) single byte functions by mbstring functions. ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), !! apache 再起動。 % sudo /System/Library/StartupItems/Apache/Apache restart !! test.php を実行するとこう。 './configure' '--enable-i18n' '--enable-mbstring' '--enable-mbstr-enc-trans' '--without-mysql' '--without-iconv' '--disable-posix' '--with-config-file-path=/Volumes/NetBSD/pkg/etc' '--with-exec-dir=/Volumes/NetBSD/pkg/libexec/php4' '--with-regex=system' '--enable-memory-limit' '--enable-track-vars' '--enable-ipv6' '--with-openssl=/usr' '--with-apxs2=/Volumes/NetBSD/pkg/sbin/apxs' '--prefix=/Volumes/NetBSD/pkg' '--host=powerpc-apple-darwin' '--mandir=/Volumes/NetBSD/pkg/man'