PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

php.ini ディレクティブ> <PHP のデバッグ
Last updated: Fri, 10 Oct 2008

view this page in

Configure オプション

中心となる configure オプションのリスト

以下のリストは、Unix 系の環境で PHP をコンパイルする際に用いられる configure スクリプトのオプションの一部です。 ほとんどのオプションはそれぞれの拡張モジュールのリファレンスページで 説明されており、ここにはありません。最新の configure オプションの 完全なリストを得るには、PHP のソースディレクトリで autoconf を実行した後、./configure --help を実行してください(インストールと設定 も参照ください)。--prefix=PREFIX のような追加の configure オプションについて興味がある方は、 » GNU configure のドキュメントが 参考になるでしょう。

注意: これらの設定はコンパイル時にのみ使用可能です。PHP の動作を 実行時に設定したい場合は、実行時設定 の章を参照ください。

PHP の Configure オプション

注意: これらのオプションは PHP 4.1.0 の時点でのものです。 しかし、中にはもっと古い PHP 有効なものがあるかもしれません。 古いバージョンをコンパイルされる場合、 おそらくいくつかのオプションは使えないでしょう。

一般的なオプション

--enable-debug

デバッグシンボルつきでコンパイルします。

--with-layout=TYPE

インストールされるファイルのレイアウトを設定します。Type には PHP(デフォルト)または GNU のどちらかが指定できます。

--with-pear=DIR

PEAR を DIR(デフォルトは PREFIX/lib/php)にインストールします。

--without-pear

PEAR をインストールしません。

--enable-sigchild

PHP 独自の SIGCHLD ハンドラを有効にします。

--disable-rpath

実行時にライブラリの検索パスを追加できないようにします。

--enable-libgcc

明示的に libgcc とリンクします。

--enable-php-streams

実験的な PHP ストリーム機能を組み込みます。PHP そのものをテストする 目的以外では使用しないでください。

--with-zlib-dir[=DIR]

zlib のインストールディレクトリを指定します。

--enable-trans-sid

透過的なセッション ID の伝播を有効にします。PHP 4.1.2 以前でのみ 有効です。PHP 4.2.0 以降、この機能は常に有効となっています。

--with-tsrm-pthreads

POSIX スレッドを使用します(デフォルト)。

--enable-shared[=PKGS]

共有ライブラリをビルドします [default=yes]。

--enable-static[=PKGS]

静的ライブラリをビルドします [default=yes]。

--enable-fast-install[=PKGS]

インストール速度を上げるように最適化します [default=yes]。

--with-gnu-ld

C コンパイラが GNU ld を使用するとみなします [default=no]。

--disable-libtool-lock

ロックを回避します(並列ビルドに失敗する可能性があります)。

--with-pic

PIC/non-PIC オブジェクトのどちらか一方のみを使用するようにします [default=use both]。

--enable-memory-limit

メモリ制限(memory limit)のサポートつきでコンパイルします (PHP 5.2.1 以降では使用できず、常に有効となります)。

--disable-url-fopen-wrapper

URL を指定した fopen で、HTTP や FTP を経由してファイルを開く機能を無効にします (PHP 5.2.5 以降では使用できません)。

--enable-versioning

要求されるシンボルのみをエクスポートします。 詳細な情報は INSTALL を参照ください。

PHP オプション

--enable-maintainer-mode

一般の利用者にとってあまり便利でない(そして時に混乱のもととなる) make ルールや依存性を有効にします。

--with-config-file-path=PATH

php.ini を探すパスを設定します。デフォルト値は PREFIX/lib です。

--enable-safe-mode

セーフモードをデフォルトで有効にします。

--with-exec-dir[=DIR]

セーフモード時には、このディレクトリにある実行ファイルのみ実行を許可します。 デフォルト値は /usr/local/php/bin です。

--enable-magic-quotes

magic quotes をデフォルトで有効にします。

--disable-short-tags

開始タグの短縮形 <? をデフォルトで無効にします。

SAPI オプション

以下のリストには、PHP で有効な SAPI(Server Application Programming Interface)が含まれています。

--with-aolserver=DIR

インストールされている AOLserver のパスを指定します。

--with-apxs[=FILE]

Apache 共有モジュールをビルドします。FILE は Apache apxs ツールへの パスで、デフォルトは apxs です。Apache のソース Tarball に含まれる apxs を指定するのではなく、そのシステムに実際にインストールされている バージョンの apxs を指定するようにしましょう。

--with-apache[=DIR]

静的 Apache モジュールをビルドします。DIR は Apache のビルドディレクトリで、 デフォルトは /usr/local/apache です。

--with-mod_charset

(ロシアの Apache 用の)mod_charset のための変換テーブルを 有効にします。

--with-apxs2[=FILE]

Apache 2.0 共有モジュールをビルドします。FILE は、オプションで指定する Apache apxs ツールへのパスです。デフォルトは apxs です。

--with-caudium=DIR

PHP を、Caudium で使用する Pike モジュールとしてビルドします。 DIR は Caudium サーバのディレクトリで、デフォルトは /usr/local/caudium/server です。

--disable-cli

PHP 4.3.0 で使用可能になりました。PHP の CLI バージョンのビルドを 無効にします(自動的に --without-pear も指定されます)。詳細な情報は PHP をコマンドラインから使用する を参照ください。

--enable-embed[=TYPE]

組み込み SAPI ライブラリのビルドを有効にします。TYPE は shared あるいは static のいずれかで、デフォルトは shared です。 PHP 4.3.0 で使用可能になりました。

--with-fhttpd[=DIR]

fhttpd モジュールをビルドします。DIR は fhttpd のソースディレクトリで、 デフォルトは /usr/local/src/fhttpd です。 PHP 4.3.0 以降、このオプションは使用できなくなりました。

--with-isapi=DIR

PHP を、Zeus の ISAPI モジュールとしてビルドします。

--with-nsapi=DIR

インストール済みの Netscape/iPlanet/SunONE Webserver へのパスを指定します。

--with-phttpd=DIR

このオプションについての情報はありません。

--with-pi3web=DIR

PHP を Pi3Web のモジュールとしてビルドします。

--with-roxen=DIR

PHP を Pike モジュールとしてビルドします。DIR は Roxen の ディレクトリで、通常は /usr/local/roxen/server です。

--enable-roxen-zts

Zend Thread Safety を使用した Roxen モジュールをビルドします。

--with-servlet[=DIR]

サーブレットのサポートを含めます。DIR は JSDK のインストールディレクトリです。 java 拡張モジュールが共有ライブラリとしてビルドされていることが 前提条件です。

--with-thttpd=SRCDIR

PHP を thttpd モジュールとしてビルドします。

--with-tux=MODULEDIR

PHP を TUX モジュールとしてビルドします(Linux 限定)。

--with-webjames=SRCDIR

PHP を WebJames モジュールとしてビルドします(RISC OS 限定)。

--disable-cgi

PHP の CGI バージョンをビルドしないようにします。 PHP 4.3.0 で使用可能になりました。

--enable-force-cgi-redirect

サーバ内でのリダイレクトの際のセキュリティチェックを有効にします。 Apache で CGI バージョンを稼動させる場合、このオプションを 使用すべきです。

--enable-discard-path

有効にすると、PHP の CGI バイナリを web ディレクトリツリーの外に 配置できるようになります。これで .htaccess によるセキュリティを 回避できなくなります。

--with-fastcgi

PHP を FastCGI アプリケーションとしてビルドします。PHP 4.3.0 以降、 このオプションは使用できません。代わりに --enable-fastcgi を使用してください。

--enable-fastcgi

有効にすると、CGI モジュールが FastCGI のサポートつきでビルドされます。 PHP 4.3.0 で使用可能になりました。

--disable-path-info-check

無効にすると、/info.php/test?a=b のようなパスは 動作しません。PHP 4.3.0 で使用可能になりました。詳細な情報は » Apache マニュアル を参照ください。



php.ini ディレクティブ> <PHP のデバッグ
Last updated: Fri, 10 Oct 2008
 
add a note add a note User Contributed Notes
Configure オプション
Thani
22-Jul-2008 01:35
One of the above mentioned to enable libxml. Instead use disable-all and enable only the required extensions. Otherwise it will complain of libxml for extensions that depend on libxml.
Neil Davis
04-Mar-2008 04:07
If you have compiled php without specifying a --with-config-file-path=PATH
then reconfigure php using --with-config-file-path=PATH, you must do a "make clean" then "make" & "make install" before reinstalling. If you don't make clean first, phpinfo will report the new location set by --with-config-file-path=PATH, but actually be looking for php.ini in the old location.

I'm not sure if this is intended behavior or not but this is a gotcha that got me after compiling, then reconfiguring, then doing make install. It caused a little head scratching.

It's good practice to do make clean after any configuration change anyway. Bite the bullet and take the time to do it right to avoid unexpected module behavior.

-Neil
raj at ap dot krakow dot pl
07-Feb-2008 08:52
It's not stated clearly anywhere in the documentation, but the CGI version won't build if you specify the --with-apxs= option to configure (the CLI version will, however). The only way I found to have *both* Apache module *and* CGI versions of PHP installed was to run configure/make twice - first with --with-apxs= option, to build the Apache module, then without it, to build the CGI binary.
I think if the doc says that the CGI version is built by default, it *should* be built by default, unless you specify --disable-cgi. If --with-apxs= automatically disables CGI, the --disable-cgi option doesn't seem to have any use.
codeslinger at compsalot dot com
30-Nov-2006 09:26
Note: PHP5 has a zillion dependencies on libxml, it is not practical to disable it, you must install it.

libxml can be found here: http://www.xmlsoft.org/

But this is actualy a good thing; "Almost everything regarding XML support was rewritten for PHP 5".

For more info see: http://www.zend.com/php5/articles/php5-xmlphp.php
jovcic ate gseis stop ucla stop edu
09-Jul-2005 02:26
If you'e compiling a shared extension (e.g. pspell) whose libs & headers are not in the usual place, use the following:

--with-pspell=shared,/my/custom/path/to/pspell/

Took me forever to figure out, since Google had no answer for me.
joerg at fenin dot de
14-Apr-2005 08:15
If some options do not become active after doing a configure; make; make install, try to do a make clean after configure. That worked for me when enabling memory limts (--enable-memory-limit).
16-Jan-2004 11:33
>/usr/local/lib needs to be listed in /etc/ld.so.conf, but it should already
>be there on most systems.  The above notes all apply to Linux only,
>but may be useful on other platforms as well

 It is much simpler just to put /usr/local/pgsql/lib into /etc/ld.so.conf and then run ldconfig.
steve at njord dot org
06-Oct-2003 01:32
If you're trying to build with --with-imap and your uw-imap stuff is built SSLTYPE=nopwd then you will fail the "Checking if IMAP works" check if you don't also build with --with-imap-ssl

Another hour and a half of my life lost to find that one.

Steve
squeeNoSpam at NoSpamAddress dot com
14-Aug-2002 08:06
[Editor's note: The reason why some general options for the "configure" scripts are not documented is that said script is part of the GNU autoconf tools, and as such its general options are documented elsewhere, e.g.: http://www.gnu.org/manual/autoconf/index.html and http://www.airs.com/ian/configure/. Some are also documented in the INSTALL file that comes with the source distribution.]

The --prefix=PREFIX configure option isn't mentioned here. It apparently defaults to /usr/local, and sets the position of the php includes and libs. (in PREFIX/include/php and PREFIX/lib/php)
tysonlt from web_SPAMOFF_media com au
15-Apr-2002 06:42
RE: Servlet support, I found that you need to configure --with-servlet=/usr/local/tomcat/common.

I found checking the configure script (always a good idea) that it looks for {dir_prefix}/lib/servlet.jar file, and this is found in the tomcat/common directory.

Hope this helps a bit!
ceo at l-i-e dot com
14-Aug-2001 08:05
--enable-sigchild is only relevent to users of Oracle who are having <defunc> processes.
petrov at rice dot edu
03-Nov-2000 06:27
If you are building with --with-pgsql=/some/dir, make sure that you still have libpq loaded up by ldconfig.  I compiled and installed postgres from the tarball and then had to manually create the symlinks in /usr/local/lib.  In particular, after you have built and installed postgres, you need to do the following (presuming you installed to /usr/local/pgsql):

# cd /usr/local/lib
# ln -s ../pgsql/lib/libpq.so.2.1 libpq.so.2.1
# ln -s ../pgsql/lib/libpq.so.2.1 libpq.so.2
# ln -s ../pgsql/lib/libpq.so.2.1 libpq.so
# ldconfig

/usr/local/lib needs to be listed in /etc/ld.so.conf, but it should already be there on most systems.  The above notes all apply to Linux only, but may be useful on other platforms as well.

--sam

php.ini ディレクティブ> <PHP のデバッグ
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites