Announcement

Collapse
No announcement yet.

Websocket , Zmq and PHP 7.4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Websocket , Zmq and PHP 7.4

    Hi,
    I am trying to enable websocket functionalities on espocrm on a windows10 machine with Apache 2.4 and PHP 7.4.
    The problem is that there is no php_zmq dll available for PHP 7.4.
    As you can see from http://pecl.php.net/package/zmq/1.1.3 , The latest php-zmq.dll available is from 2016 and is not compatible with php versions > 7.2 (https://github.com/zeromq/php-zmq/issues/193).
    How can i enable websocket on a server with a version of Php >7.2? Are Espocrm Websockets supported only on PHP versions < 7.3?

    Thank you


  • #2
    Hi,

    Not sure about windows. But on linux it's not a problem to build for php versions > 7.2 https://github.com/espocrm/docker/bl...Dockerfile#L21

    Comment


    • #3
      Originally posted by yuri View Post
      Hi,

      Not sure about windows. But on linux it's not a problem to build for php versions > 7.2 https://github.com/espocrm/docker/bl...Dockerfile#L21

      Hi yuri, thank you for the response,
      I tried the compiled versions found on https://github.com/zeromq/php-zmq/issues/193, the 7.3 version works fine on PHP 7.3, but with the 7.4 version, on php 7.4, apache crashes with the following error:
      Parent: child process 7412 exited with status 3221225725 -- Restarting.

      i then built the latest version of php_zmq on windows by following this guide (https://blog.7in0.me/2020/03/29/buil...on-on-windows/) and the generated php_zmq.dll, on PHP 7.4, makes apache crash with the same error as above.

      So, there seems to be no way to make websockets works on a windows machine with php>7.3.
      If you have any suggestion they will be highly appreciated.

      Comment


      • Ceonello
        Ceonello commented
        Editing a comment
        With Linux it use a file called php_zmq.so specifically compiled for Linux so it's not as easy as copying it.
        I don.t know why it's working on linux and not on windows

      • espcrm
        espcrm commented
        Editing a comment
        I tried searching for some solution but look like you are on your own at this stage. Can't think of any other idea aside as perhaps trying v8.0, by shear luck it could be compatible? Or downgrade to 7.3

      • Ceonello
        Ceonello commented
        Editing a comment
        Thank you, we are going to try with php8. I'll keep you in touch.

    • #4
      Hi, a little update that maybe could help someone with the same problems.
      We upgraded the server to PHP8, switched Apache to fcgid_module (from php_module) and compiled a php_zmq.dll (VS16 x64 Thread Safe) using the PHP8 sources and the latest zmq sources available.
      Now Websockets seems to work correctly.
      We suspect that the problem is related to php_module and not to apache or php versions.
      If someone need it, we can share the compiled php_zmq.dll.

      Thank you

      Comment


      • espcrm
        espcrm commented
        Editing a comment
        I personally don't need it (yet), but would be good if you just go ahead and share it. That way when someone do need it, they don't need to wait and can just grab the file. You probably want to use a long lasting host though, one of the Git maybe?

    • #5
      Here it is, php_zmq.dll Thread Safe , PHP8, vs16 x64
      Attached Files

      Comment


      • #6
        Hi. Can you share php_zmq.dll for php7.4 ?

        Comment


      • #7
        Thread safe x64 VC15 php 7.4.13
        Attached Files

        Comment


        • #8
          Unfortunately it does not work. I tested on php 7.4.13 and 7.4.20
          After adding to the ext directory and change settings in php.ini, I got the message:

          PHP Warning: PHP Startup: Unable to load dynamic library 'zmq'. The specified module could not be found ...

          When another module, e.g. php_ldap.dll, I change the name to php_zmq.dll, then I do not receive this message

          Comment


          • #9
            try with the one attached to this thread https://github.com/zeromq/php-zmq/issues/193

            https://github.com/zeromq/php-zmq/fi...15-zts-nts.zip

            remember that you will have to switch apache to fcgid_module (from php_module) to make it works tho (or at least this is what we have done)
            Last edited by Ceonello; 07-08-2021, 10:30 AM.

            Comment


            • #10
              Sorry to resurrect an ancient thread, but would it be possible for you share a NTS version that works with PHP 8.1 or 8.2? I can't seem to find one anywhere and I have no idea how to build it. Thanks in advance.

              Comment


              • #11
                What does NTS stand for?

                I believe you should be able to install it with:

                Code:
                sudo apt-get install php-zmq

                Comment


                • #12
                  Originally posted by yuri View Post
                  What does NTS stand for?

                  I believe you should be able to install it with:

                  Code:
                  sudo apt-get install php-zmq
                  NTS = Non-Thread Safe. This is for Windows.

                  Comment


                  • #13
                    version that works with PHP 8.1 or 8.2?

                    Comment


                    • #14
                      up please

                      Comment


                      • #15
                        Hi Abidoss, I was never able to get websocket working using windows, it’s better if you host everything in a linux environment.

                        you could use windows subsystem for linux.

                        Comment

                        Working...
                        X