0

開発ボックスで使用している PHP の make では、xmlreader および xmlwriter 拡張機能が有効になっていないことに気付きました。これらの拡張機能を有効にするには、PHP を再コンパイルする必要があることは理解しています (または、デフォルトで有効になっているため、無効化をより正確に削除する必要があります)。 ./configure および make コマンド。

phpinfo() 出力からの構成コマンドは次のとおりです。

'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' \
 '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' \
 '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' \
 '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' \
 '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' \
 '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' \
 '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' \
 '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' \
 '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' \
 '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' \
 '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' \
 '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' \
 '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' \
 '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' \
 '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' \
 '--enable-calendar' '--without-mime-magic' '--without-sqlite' \
 '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' \
 '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' \
 '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' \
 '--disable-xmlwriter' '--without-sqlite3' '--disable-phar' '--disable-fileinfo' \
 '--disable-json' '--without-pspell' '--disable-wddx' '--without-curl' \
 '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' 

--disable-xmlreader および --disable-xmlwriter でコンパイルされていることに注意してください。http://www.php.net/manual/en/xmlwriter.installation.phpのドキュメントによると、この拡張機能はデフォルトで有効になっています。この拡張機能の無効化を「元に戻す」にはどうすればよいですか?

私の目標は、PHPExcel クラス セット ( http://phpexcel.codeplex.com/ ) を使用できるようにすることですが、クラスの 1 つが XMLWriter クラスを拡張しようとしているため、致命的なエラーが発生します。

4

2 に答える 2

2

バイナリ パッケージ (openSUSE など) を含むディストリビューションのいずれかを使用している場合は、拡張機能として php-xmlwriter パッケージをインストールするだけで十分です。

別のオプション - バージョンのソースを取得し、phpize を使用して xmlwriter をモジュールとしてコンパイルするだけです (これについてさらにヘルプが必要な場合はお知らせください)。

それでもうまくいかない場合は、ソースを入手して、すべてを最初からコンパイルする必要があります。その場合、構成は、ソースを抽出したフォルダーから実行されます。

覚えておくべき追加事項 - 現在インストールしている拡張機能 - それらをコンパイルするか、取得したソースを使用して再構築する必要があります (php のバージョンが一致しない限り、既にインストールされているものを使用できます)。

最後に、ディストリビューションには通常、いくつかの php バイナリ (CGI、Apache モジュール、cli など) が付属しています。configureコマンドでもこれ(または必要な部分)が有効になっていることを確認する必要があります。

于 2011-03-08T15:11:53.680 に答える
1

ソースを抽出したディレクトリ (例: /home/user/php-5.3.5) で configure コマンドを実行するだけで、これら 2 つのオプションは含めません。すなわち:

./configure -prefix=/usr ... <everything but --disable-xmlreader and --disable-xmlwriter>
于 2011-03-08T15:04:27.783 に答える