pecl install event
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading event-2.3.0.tgz ...
Starting to download event-2.3.0.tgz (135,401 bytes)
.............................done: 135,401 bytes
50 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
Enable internal debugging in Event :
Enable sockets support in Event :
libevent installation prefix :
Include libevent's pthreads library and enable thread safety support in Event :
Include libevent protocol-specific functionality support including HTTP, DNS, and RPC :
Include libevent OpenSSL support : no
openssl installation prefix :
building in /var/tmp/pear-build-root3Lzc49/event-2.3.0
running: /var/tmp/event/configure --with-php-config=/usr/bin/php-config --enable-event-debug=no --enable-event-sockets=yes --with-event-libevent-dir=/usr --with-event-pthreads=no --with-event-extra --with-event-openssl=no --with-openssl-dir=no
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 for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for Event core support... yes, shared
checking for Event thread safety support... no
checking for Event extra functionality support... yes
checking for OpenSSL support in event... no
checking for OpenSSL installation prefix... no
checking whether Event debugging support enabled... no
checking whether to enable sockets support in Event... yes
checking PHP version... PHP 7.x
checking for include/event2/event.h... not found
configure: error: Please reinstall the event library, or provide the installation prefix via --with-event-libevent-dir option
ERROR: `/var/tmp/event/configure --with-php-config=/usr/bin/php-config --enable-event-debug=no --enable-event-sockets=yes --with-event-libevent-dir=/usr --with-event-pthreads=no --with-event-extra --with-event-openssl=no --with-openssl-dir=no' failed
安装时报了这个错,是不是php7没法安装event扩展
看起来是没装libevent-dev包吧
我安装了呢,是用的yum直接安装的
php5.3以上我都是按照手册上的步骤安装的
php7可能需要装 libeven2t-dev,猜的
哦哦,我看看。手册上面没讲,网上给的都是编译安装的,编译安装后,php -m后报了个错,如下:PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/event.so' - /usr/lib64/php/modules/event.so: undefined symbol: php_sockets_le_socket in Unknown on line 0。不知道什么原因