php:debian gnu / linuxでopenssl、ftp、ldap、curlサポートにコンパイル

php:debian gnu / linuxでopenssl、ftp、ldap、curlサポートにコンパイル

Debian GNU/Linux で PHP 5.2.x をコンパイルしようとしています。

./configure --with-ldap --enable-ftp --with-apxs2 --with-mcrypt --enable-bcmath --with-bz2 --enable-calendar --enable-dba=shared --enable-exif --with-gettext --enable-mbstring --with-mhash --with-readline --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-wddx --enable-zip --with-zlib --with-xsl

作る

完璧に動作しますが、カールが必要です。

./configure --with-ldap --enable-ftp --with-apxs2 --with-mcrypt --enable-bcmath --with-bz2 --enable-calendar --enable-dba=shared --enable-exif --with-gettext --enable-mbstring --with-mhash --with-readline --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-wddx --enable-zip --with-zlib --with-xsl --with-curl

作る

間違い:

/usr/bin/ld: ext/curl/.libs/interface.o: 'CRYPTO_set_id_callback@@OPENSSL_1.0.0' シンボルの未定義参照 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0. 0: エラー記号の追加: コマンドラインに DSO がありません。 Collect2: エラー: ld が 1 終了状態を返しました。 Makefile: 241: 'sapi/cli/php' ターゲットのレシピが失敗しました。

dpkg -l | dpkg -l |

ii libcurl4-openssl-dev:amd64 7.38.0-4+deb8u5
amd64 libcurl用の開発ファイルとドキュメント(OpenSSLスタイル)

ii libgnutls-openssl27:amd64 3.3.8-6+deb8u3
amd64 GNU TLS ライブラリ - OpenSSL ラッパー

ii openssl 1.0.1t-1+deb8u5
amd64 Secure Sockets Layer(SSL)ツールキット - 暗号化ユーティリティ

dpkg -l | dpkg -l |

ii curl 7.38.0-4+deb8u5
URL構文を介してデータを転送するためのamd64コマンドラインツール

ii libcurl3:amd64 7.38.0-4+deb8u5
amd64使いやすいクライアントURLトランスポートライブラリ(OpenSSLスタイル)

ii libcurl3-gnutls:amd64 7.38.0-4+deb8u5
amd64使いやすいクライアントURLトランスポートライブラリ(GnuTLSスタイル)

ii libcurl4-openssl-dev:amd64 7.38.0-4+deb8u5
amd64 libcurl用の開発ファイルとドキュメント(OpenSSLスタイル)

修正する:エラーはopensslをサポートするFTPに関連しています。

./configure --with-openssl --enable-ftp

作る

ext/openssl/openssl.o: In function `zm_startup_openssl':
/usr/src/php-5.2.17/ext/openssl/openssl.c:681: undefined reference to `SSL_library_init'
...
collect2: error: ld returned 1 exit status
Makefile:228: recipe for target 'sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1

ベストアンサー1

問題はopensslです。私はopenssl 0.9.8をインストールしました。源泉:

/usr/srcエラーのため、マニュアルページなしでコンパイルしてインストールしてください。

./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl no-asm -fPIC

作る

Install_sw

次に、phpこのオプションを使用してコンパイルします。

./configure --with-openssl=/usr/local/openssl --with-openssl-dir=/usr/local/openssl --with-curl --enable-ftp --with-ldap --with-apxs2 -- -enable-bcmath --with-bz2 --enable-calendar --enable-exif --enable-mbstring --with-mhash --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg -- -enable-zip --with-zlib

作る

修正する:5.6.28でも動作します。

おすすめ記事