我正在尝试在 Fedora 16 服务器上通过 pecl 安装 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。有什么想法吗?
答案1
要在 openssl 不在预期的 /usr 上但仍可在系统范围内访问的系统上正确安装 stomp 扩展(使用 pecl),只需输入“yes”即可,而不必指定用于查找库的文件夹。
參考文獻:https://bugs.php.net/bug.php?id=63935
这将强制系统找到系统默认值。
如果您使用手动编译,只需声明“--with-openssl”,而不是在其后添加“=”:
答案2
对于 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'],
}