无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的

[求助] 在给php添加sockets.so模块的时候报错

[root@sky ~]# service nginxd restart
Stopping nginx:                                            [  OK  ]
Shutting down php_fpm . done
Starting nginx:                                            [  OK  ]
Starting php_fpm PHP Warning:  PHP Startup: Unable to load dynamic library '/www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/sockets.so' - /www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/sockets.so: cannot open shared object file: No such file or directory in Unknown on line 0
done

我是这样添加的:

1、进入php源文件下ext/sockets目录
cd /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/
2、执行命令
[root@sky sockets]# /www/wdlinux/php/bin/phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
3、编译安装
[root@sky sockets]# ./configure --enable-sockets --with-php-config=/www/wdlinux/php/bin/php-config
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... /www/wdlinux/php
checking for PHP includes... -I/www/wdlinux/php/include/php -I/www/wdlinux/php/include/php/main -I/www/wdlinux/php/include/php/TSRM -I/www/wdlinux/php/include/php/Zend -I/www/wdlinux/php/include/php/ext -I/www/wdlinux/php/include/php/ext/date/lib
checking for PHP extension directory... /www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613
checking for PHP installed headers prefix... /www/wdlinux/php/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 whether to enable sockets support... yes, shared
checking for struct cmsghdr... yes
checking for hstrerror... yes
checking for socketpair... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
./configure: line 5967: /usr/bin/file: No such file or directory
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1966080
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged

[root@sky sockets]# make
/bin/sh /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/libtool --mode=install cp ./sockets.la /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/modules
cp ./.libs/sockets.so /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/modules/sockets.so
cp ./.libs/sockets.lai /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/modules/sockets.la
PATH="$PATH:/sbin" ldconfig -n /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

TOP

[root@sky sockets]# make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'sockets.so'  in Unknown on line 0

Warning: PHP Startup: Invalid library (maybe not a PHP library) 'sockets.so'  in Unknown on line 0
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'sockets.so'  in Unknown on line 0

Warning: PHP Startup: Invalid library (maybe not a PHP library) 'sockets.so'  in Unknown on line 0

=====================================================================
PHP         : /www/wdlinux/php/bin/php
PHP_SAPI    : cli
PHP_VERSION : 5.2.17p1
ZEND_VERSION: 2.2.0
PHP_OS      : Linux - Linux sky 2.6.32-220.23.1.el6.x86_64 #1 SMP Mon Jun 18 18:58:52 BST 2012 x86_64
INI actual  : /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets/tmp-php.ini
More .INIs  :  
CWD         : /usr/src/lanmp/lanmp/php-5.2.17/ext/sockets
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2012-07-05 12:07:17
=====================================================================
FAIL Bug 46360 - TCP_NODELAY constant (sock_get_option, sock_set_option) [tests/bug46360.phpt]
FAIL IPv4 Loopback test [tests/ipv4loop.phpt]
SKIP IPv6 Loopback test [tests/ipv6loop.phpt] reason: no IPv6 support
FAIL Test parameter handling in socket_accept() [tests/socket_accept-wrongparams.phpt]
FAIL ext/sockets - socket_bind - basic test [tests/socket_bind.phpt]
FAIL ext/sockets - socket_bind - test with empty parameters [tests/socket_bind_params.phpt]
FAIL ext/sockets - socket_close - test with empty parameters [tests/socket_close_params.phpt]
FAIL Test error cases when creating a socket [tests/socket_connect_error.phpt]
FAIL ext/sockets - socket_connect - test with empty parameters [tests/socket_connect_params.phpt]
SKIP Test if socket_create_listen() returns false, when it cannot bind to the port. [tests/socket_create_listen-nobind.phpt] reason: Test cannot be run as root.
FAIL Test if socket_create_listen throws E_WARNING with wrong parameters. [tests/socket_create_listen-wrongparams.phpt]
FAIL Test if socket binds on 31338 [tests/socket_create_listen.phpt]
FAIL ext/sockets - socket_create_listen - test for empty parameters [tests/socket_create_listen_params.phpt]
FAIL ext/sockets - socket_create_listen - test for used socket [tests/socket_create_listen_used.phpt]
FAIL Test parameter handling in socket_create_pair() [tests/socket_create_pair-wrongparams.phpt]
FAIL Test for socket_create_pair() [tests/socket_create_pair.phpt]
FAIL ext/sockets - socket_create - test with empty parameters [tests/socket_create_params.phpt]
FAIL ext/sockets - socket_getsockname - basic test [tests/socket_getpeername.phpt]
FAIL ext/sockets - socket_getpeername_ipv4loop - basic test [tests/socket_getpeername_ipv4loop.phpt]
SKIP ext/sockets - socket_getpeername_ipv6loop - basic test [tests/socket_getpeername_ipv6loop.phpt] reason: no IPv6 support
FAIL ext/sockets - socket_getsockname - basic test [tests/socket_getsockname.phpt]
FAIL Test parameter handling in socket_listen(). [tests/socket_listen-wrongparams.phpt]
FAIL ext/sockets - socket_listen - test with empty parameters [tests/socket_listen_params.phpt]
FAIL ext/sockets - socket_read- test with empty parameters [tests/socket_read_params.phpt]
FAIL Test parameter handling in socket_select(). [tests/socket_select-wrongparams-1.phpt]
FAIL Test parameter handling in socket_select(). [tests/socket_select-wrongparams-2.phpt]
FAIL Test parameter handling in socket_select(). [tests/socket_select-wrongparams-3.phpt]
FAIL Test parameter handling in socket_select(). [tests/socket_select-wrongparams-4.phpt]
FAIL Test parameter handling in socket_select(). [tests/socket_select.phpt]
FAIL Test if socket_recvfrom() receives data sent by socket_sendto() via IPv4 UDP [tests/socket_sentto_recvfrom_ipv4_udp.phpt]
SKIP Test if socket_recvfrom() receives data sent by socket_sendto() via IPv6 UDP [tests/socket_sentto_recvfrom_ipv6_udp.phpt] reason: no IPv6 support
FAIL Test if socket_recvfrom() receives data sent by socket_sendto() through a Unix domain socket [tests/socket_sentto_recvfrom_unix.phpt]
FAIL Test socket_set_block return values [tests/socket_set_block-retval.phpt]
FAIL Test if socket_set_block throws E_WARNING with wrong parameters. [tests/socket_set_block-wrongparams.phpt]
FAIL Test socket_set_nonblock return values [tests/socket_set_nonblock-retval.phpt]
FAIL Test if socket_set_nonblock throws E_WARNING with wrong parameters. [tests/socket_set_nonblock-wrongparams.phpt]
FAIL ext/sockets - socket_set_block - basic test [tests/socket_set_nonblock.phpt]
SKIP Test if socket_set_option() returns 'unable to set socket option' failure for invalid options [tests/socket_set_option_error_socket_option.phpt] reason: Test cannot be run as root.
FAIL Test if socket_set_option() works, option:SO_RCVTIMEO [tests/socket_set_option_rcvtimeo.phpt]
FAIL Test if socket_set_option() works, option:SO_SEOLINGER [tests/socket_set_option_seolinger.phpt]
FAIL Test if socket_set_option() works, option:SO_SNDTIMEO [tests/socket_set_option_sndtimeo.phpt]
FAIL ext/sockets - socket_strerror - basic test [tests/socket_strerror.phpt]
FAIL ext/sockets - socket_write - test with empty parameters [tests/socket_write_params.phpt]
FAIL Unix domain socket Loopback test [tests/unixloop.phpt]
=====================================================================
TIME END 2012-07-05 12:07:21

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   38
---------------------------------------------------------------------

Number of tests :   44                39
Tests skipped   :    5 ( 11.4%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   39 ( 88.6%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    4 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug 46360 - TCP_NODELAY constant (sock_get_option, sock_set_option) [tests/bug46360.phpt]
IPv4 Loopback test [tests/ipv4loop.phpt]
Test parameter handling in socket_accept() [tests/socket_accept-wrongparams.phpt]
ext/sockets - socket_bind - basic test [tests/socket_bind.phpt]
ext/sockets - socket_bind - test with empty parameters [tests/socket_bind_params.phpt]
Test socket_set_nonblock return values [tests/socket_set_nonblock-retval.phpt]
Test if socket_set_nonblock throws E_WARNING with wrong parameters. [tests/socket_set_nonblock-wrongparams.phpt]
ext/sockets - socket_set_block - basic test [tests/socket_set_nonblock.phpt]
Test if socket_set_option() works, option:SO_RCVTIMEO [tests/socket_set_option_rcvtimeo.phpt]
Test if socket_set_option() works, option:SO_SEOLINGER [tests/socket_set_option_seolinger.phpt]
Test if socket_set_option() works, option:SO_SNDTIMEO [tests/socket_set_option_sndtimeo.phpt]
ext/sockets - socket_strerror - basic test [tests/socket_strerror.phpt]
ext/sockets - socket_write - test with empty parameters [tests/socket_write_params.phpt]
Unix domain socket Loopback test [tests/unixloop.phpt]
=====================================================================

You may have found a problem in PHP.
We would like to send this report automatically to the
PHP QA team, to give us a better understanding of how
the test cases are doing. If you don't want to send it
immediately, you can choose "s" to save the report to
a file that you can send us later.
Do you want to send this report now? [Yns]:

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text):

Posting to qa.php.net /buildtest-process.php

Thank you for helping to make PHP better.

TOP

[root@sky sockets]# make install
Installing shared extensions:     /www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613/
[root@sky sockets]# ll /www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613
lrwxrwxrwx 1 root root 57 Jun 20 17:24 /www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613 -> /www/wdlinux/php/lib/php/extensions/no-debug-zts-20060613
[root@sky sockets]# vim /www/wdlinux/wdcp/php
phpdb/      phpmyadmin/
[root@sky sockets]# vim /www/wdlinux/wdcp/php
phpdb/      phpmyadmin/
[root@sky sockets]# vim /www/wdlinux/wdcp/l
left.php     license.txt  login.php   
[root@sky sockets]# find / -name php.ini
/www/wdlinux/etc/php.ini
/www/wdlinux/Zend/etc/php.ini
/www/wdlinux/wdphp/lib/php.ini
/www/wdlinux/wdcp_bk/conf/php.ini
[root@sky sockets]# /usr/local/php5/bin/php -v
-bash: /usr/local/php5/bin/php: No such file or directory
[root@sky sockets]# /www/wdlinux/php/bin/php -v
PHP 5.2.17p1 (cli) (built: Jul  5 2012 16:44:35)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
[root@sky sockets]# /www/wdlinux/php/bin/php -m
[PHP Modules]
bcmath
bz2
ctype
curl
date
dom
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcre
PDO
pdo_sqlite
posix
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

[root@sky sockets]# service nginxd restart
Stopping nginx:                                            [  OK  ]
Shutting down php_fpm . done
Starting nginx:                                            [  OK  ]
Starting php_fpm PHP Warning:  PHP Startup: Unable to load dynamic library '/www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/sockets.so' - /www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/sockets.so: cannot open shared object file: No such file or directory in Unknown on line 0
done
[root@sky sockets]#

TOP

显示是支持了,但就是不行,还报错Starting php_fpm PHP Warning:  PHP Startup: Unable to load dynamic library '/www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/sockets.so' - /www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/sockets.so: cannot open shared object file: No such file or directory in Unknown on line 0

TOP

就修改php.ini,其他地方没有做修改,有没有人帮忙

TOP

目录是这个
/www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613/
而不是
/www/wdlinux/wdphp/lib/php/extensions/no-debug-non-zts-20060613/
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

在这里找到解决方法了,但不够详细。。   现在 DX后台可以使用 SOCKET 连接SMTP发信,,并成功了。

过下写个步骤来。

TOP

你可以整理一个出来
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

返回列表