在 Fedora 16 上通過 pecl 安裝 stomp 失敗(找不到 OpenSSL 的庫)
我正在嘗試通過 pecl 在 Fedora 16 伺服器上安裝 stomp php 擴展。在 centos 上我有類似的問題,但在安裝 openssl-devel 後一切順利,我安裝了 stomp。在 Fedora 伺服器上(安裝了 openssl,openssl-devel)我得到:
pecl install stomp downloading stomp-1.0.4.tgz ... Starting to download stomp-1.0.4.tgz (18,354 bytes) ......done: 18,354 bytes 6 source files, building running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 OpenSSL install prefix (no to disable SSL support) [/usr] : /usr building in /var/tmp/pear-build-root2Uodkk/stomp-1.0.4 running: /var/tmp/stomp/configure --with-openssl-dir=/usr checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib64/php/modules checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... re2c checking for re2c version... 0.13.5 (ok) checking for gawk... gawk checking whether to enable stomp support... yes, shared checking OpenSSL dir for stomp... /usr checking for pkg-config... /usr/bin/pkg-config configure: error: Cannot find OpenSSL's libraries ERROR: `/var/tmp/stomp/configure --with-openssl-dir=/usr' failed
我首先想到的 openSSL 安裝前綴是錯誤的,但相同的前綴在 centos 上工作得很好??
我還安裝了 openssl php 擴展。
編輯:更多資訊:
PHP 版本 => 5.3.18
php-pear-1.9.4
安裝的 PHP 模組: gd gettext gmp hash iconv imap json ldap libxml mbstring mcrypt memcache mhash mongo mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar readline Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard tidy tokenizer wddx xapian xml xmlreader xmlwriter xsl zip zlib
也許我忘記了什麼。不知道該怎麼做,因為安裝了正確的 openssl 和 openssl-devel。有任何想法嗎?
要在 openssl 不在預期的 /usr 上但仍然可以在系統範圍內訪問的系統上正確安裝 stomp 擴展(使用 pecl),而不是指定用於查找庫的文件夾,只需鍵入“yes”。
參考:https ://bugs.php.net/bug.php?id=63935
這將強制系統查找系統預設值。
如果您使用手動編譯,只需聲明“–with-openssl”,而不是在其後添加“=”:
對於 CentOS 6.3 和
openssl-1.0.0-25.el6_3.1.x86_64 openssl-devel-1.0.0-25.el6_3.1.x86_64
如果 pecl install stomp 拋出錯誤,您可能必須在 /usr/lib 目錄中創建連結:
checking for pkg-config... /usr/bin/pkg-config configure: error: Cannot find OpenSSL's libraries ERROR: `/var/tmp/stomp/configure --with-openssl-dir=/usr' failed
克服的傀儡食譜
# Handle pecl install error on x86_64 CentOS 6.3 if $architecture == 'x86_64' { file {'/usr/lib/libssl.so': ensure => link, target => '/usr/lib64/libssl.so', require => Package['openssl', 'openssl-devel'], before => Exec['install_pecl_stomp'], } file {'/usr/lib/libcrypto.so': ensure => link, target => '/usr/lib64/libcrypto.so', require => Package['openssl', 'openssl-devel'], before => Exec['install_pecl_stomp'], } $pecl_lib_dir = 'lib64' } else { $pecl_lib_dir = 'lib' } exec {'install_pecl_stomp': command => 'printf "/usr" | pecl install stomp', creates => "/usr/${pecl_lib_dir}/php/modules/stomp.so", require => Package['php', 'openssl', 'openssl-devel'], }