Apache + PHP + Pthreads のインストール方法

Apache + PHP + Pthreads のインストール方法

04 LTS 64 ビット。

私が本当にやりたいのは、sudo apt-get install libapache2-mod-php5PHP を でコンパイルして、--enable-maintainer-zts後で で pthreads をインストールできるようにすることpecl install pthreadsです。残念ながら、それは不可能だと理解しています。最も簡単な方法は、Apache サポートと ZTS とともに PHP を再コンパイルすることだとわかっています。ただし、標準の Ubuntu PHP パッケージの構成方法は非常に気に入っており、CLI php.ini 構成、Apache php.ini 構成、およびこの Ubuntu パッケージが定義するモジュールとファイルのその他のパスに慣れています。そのため、パッケージ ソースを少し変更してインストールしたいだけです。

# Get the stuff necessary to build the package
sudo apt-get build-dep php5-common

# Get the package source
sudo apt-get source php5-common

この時点では、php5-common パッケージのソースではなく、php5 パッケージ全体のソースを取得しています。sudo make && make installこの時点で取得すると、不要なものをたくさんインストールすることになるのでしょうか?

# Add configuration options
./configure --enable-maintainer-zts

これは、構成オプションを追加していることを意味しますか? それとも、まったく新しい構成を生成しているのでしょうか?

この時点での代替案このパッケージが定義する設定オプションを取得する方法はありますか?php.netからphpソースを取得してコンパイルすることができます。

$ ./configure  --prefix=package_prefix \ // Option 1 from package
--enable-embed \ // Option 2 from package
--with-regex=php \ // Option 3 from package

主なアイデアを続けます...

解決策1

# Compile (Not compiling)
sudo make && make install

sudo apt-get purge php5この時点で、PHP をあらゆるものを使ってビルドすることになりますか? このようにコンパイルすると、 ?を使用して作成した混乱を取り除くことができなくなります。

解決策2

# ReCompile the package
dpkg-buildpackage -rfakeroot -uc -b

これもコンパイルされません。すべてを正しくインストールできるように、手順を修正してください。

答え1

オプションは次のように簡単に取得できます (ソース パッケージを確認することもできますが、この方がはるかに手間がかかりません)。

$ sudo apt-get install php5-dev
$ php-config --configure-options

--prefix=/usr --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2 
--with-config-file-scan-dir=/etc/php5/apache2/conf.d --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man 
--disable-debug --with-regex=php --disable-rpath --disable-static --with-pic 
--with-layout=GNU --with-pear=/usr/share/php --enable-calendar --enable-sysvsem 
--enable-sysvshm --enable-sysvmsg --enable-bcmath --with-bz2 --enable-ctype 
--with-db4 --without-gdbm --with-iconv --enable-exif --enable-ftp --with-gettext 
--enable-mbstring --with-pcre-regex=/usr --enable-shmop --enable-sockets 
--enable-wddx --with-libxml-dir=/usr --with-zlib --with-kerberos=/usr 
--with-openssl=/usr --enable-soap --enable-zip --with-mhash=yes --with-system-tzdata 
--with-mysql-sock=/var/run/mysqld/mysqld.sock --enable-dtrace --without-mm 
--with-curl=shared,/usr --with-enchant=shared,/usr --with-zlib-dir=/usr 
--with-gd=shared,/usr --enable-gd-native-ttf --with-gmp=shared,/usr 
--with-jpeg-dir=shared,/usr --with-xpm-dir=shared,/usr/X11R6 
--with-png-dir=shared,/usr --with-freetype-dir=shared,/usr 
--with-vpx-dir=shared,/usr --enable-intl=shared --without-t1lib 
--with-ldap=shared,/usr --with-ldap-sasl=/usr --with-mysql=shared,/usr 
--with-mysqli=shared,/usr/bin/mysql_config --with-pspell=shared,/usr 
--with-unixODBC=shared,/usr --with-recode=shared,/usr --with-xsl=shared,/usr 
--with-snmp=shared,/usr --with-sqlite3=shared,/usr --with-mssql=shared,/usr 
--with-tidy=shared,/usr --with-xmlrpc=shared --with-pgsql=shared,/usr

man php-configさらに多くのオプションについては、を参照してください。

関連情報