How to enable Socket in PHP?

前端 未结 5 885
再見小時候
再見小時候 2020-12-29 02:33

Could any one tell me how to enable SOCKET support in PHP ?

相关标签:
5条回答
  • 2020-12-29 03:01

    The PHP Docker images come with 3 helper script commands that make installing and configuring extensions easier:

    • docker-php-ext-configure: This command allows you to provide the custom arguments for an extension.
    • docker-php-ext-install: Use this command to install new extensions in your container.
    • docker-php-ext-enable: This command can be used to enable PHP extensions.

    Run

    docker-php-ext-install sockets
    

    Reference: https://confluence.atlassian.com/bitbucket/php-with-bitbucket-pipelines-873907835.html#PHPwithBitbucketPipelines-InstallandenablePHPextensions

    0 讨论(0)
  • 2020-12-29 03:03

    here are noobs instructions

    • go to your php installation directory in windows it can be something like this c:\xampp\php

    • the goto ext direction in it php\ext\

    • check if your have php_sockets.dll in that directory
    • after that open php.ini file which will be in your php folder
    • next search for ;extension=php_sockets.dll

    if you find it then remove ; from it

    if you not find it then search for extension=

    and then below some extension add extension=php_sockets.dll

    • and finally restart your apache.
    0 讨论(0)
  • 2020-12-29 03:04

    For those of you that having this problem when installing RabbitMQ php library

    Problem 1

    • Installation request for php-amqplib/php-amqplib ^2.11 -> satisfiable by php- amqplib/php-amqplib[v2.11.0].
    • php-amqplib/php-amqplib v2.11.0 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.

    Solution

    change ;extension=sockets to extension=sockets over php.init

    Screenshot

    Notes:

    Not sockets.dll, only sockets

    0 讨论(0)
  • 2020-12-29 03:13

    This answer assumes you do have a php_sockets.dll extension file accessible (in your PHP installation extension directory or where required);

    If you're using windows, just uncomment the following line in your php.ini file:

    ;extension=php_sockets.dll
    

    If you are missing the php_sockets.dll, you can download it from php.net.

    0 讨论(0)
  • 2020-12-29 03:14

    The socket functions described here are part of an extension to PHP which must be enabled at compile time by giving the --enable-sockets option to configure.

    From the extension's documentation.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题