开发者社区 问答 正文

php的getprotobyname返回FALSE是什么原因呢?怎么解决??报错

今天测试  socket_create(AF_INET,SOCK_STREAM,SOL_TCP)时发现报错:
Warning : socket_create() expects parameter 3 to be long,然后就用了 getprotobyname('tcp')这个函数,发现返回FALSE,请问是什么原因啊?怎么解决?急!

环境:linux系统

展开
收起
爱吃鱼的程序员 2020-06-14 20:52:26 540 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    getprotobyname()returnstheprotocolnumberassociatedwiththeprotocolnameasper/etc/protocols.

    Returnstheprotocolnumber,orFALSEonfailure.

    我的内核版本不一样,etc下没有protocols文件
    2020-06-14 20:52:43
    赞同 展开评论
问答分类:
问答地址: