Home  >  Article  >  Backend Development  >  php socket_create调用有关问题

php socket_create调用有关问题

WBOY
WBOYOriginal
2016-06-13 13:44:22894browse

php socket_create调用问题
系统是WIN2003、IIS+PHP+DZ(php5isapi.dll)搭建的环境.

DZX2的论坛完全没问题,但是我手动运行php xxx.php文件时提示socket_create调用失败

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
D:\host\php>php-cgi.exe D:\Host\php\cross.php
X-Powered-By: PHP/5.2.5
Content-type: text/html

<br>
<b>Fatal error</b>:  Call to undefined function socket_create() in <b>D:\host\p
p\cross.php</b> on line <b>66</b><br>
Error in my_thread_global_end(): 1 threads didn't exit

D:\host\php>


PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
D:\host\php>php.exe cross.php

Fatal error: Call to undefined function socket_create() in D:\host\php\cross.php
 on line 66

D:\host\php>



确定php.ini中开启,并且DLL已经全部拷贝到SYSTEM32了,我在IIS里运行phpinfo时效果:



求达人解答,不盛感激!

------解决方案--------------------
phpinfo 显示的是web 的配置环境. 而你的是命令行,修改系统环境里的路径到现在的php路径一致一般就可以解决问题了.
------解决方案--------------------
D:\host\php>php.exe cross.php 将使用与 php.exe 处于同一目录下的 php.ini

如果你的 php 是绿色安装的,那么不会出现问题
但你“DLL已经全部拷贝到SYSTEM32了”,显然不是绿色安装的
------解决方案--------------------
复制回来
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn