The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php7 and Pthreads + ZTS

Discussion in 'EasyApache' started by mybeshoo, Sep 4, 2016.

  1. mybeshoo

    mybeshoo Member

    Joined:
    Mar 10, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Damascus, Syria, Syria
    Hello all ,
    Since EasyApache 3 in Deprecation mode , so we have to move to the EasyApache 4 which is what i did .

    unfortunately PHP7 RPM dos not support ZTS in order to install Pthreads !

    I did contact Support , thy side

    Thy advice me to go back to EasyApache 3 !!!


    Ok , i do understand that adding ZTS support is not as click of button ! and we need to recompile the php7 source and install the RPM

    Please Cpane , you have 2 options
    1 - Make a blog an Easy Step By Step , of how to install this , php7 with pthreads support.
    2 - Support it in EasyApache 4 as an option.

    it is our right to use pthreads with php7
     
    #1 mybeshoo, Sep 4, 2016
    Last edited by a moderator: Sep 4, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    More information on the decision to compile PHP without thread safety is available at:

    PHP: Installation - Manual

    Could you provide some more information on why you prefer to use thread safety? Do certain applications fail when it's disabled?

    Thank you.
     
  3. mybeshoo

    mybeshoo Member

    Joined:
    Mar 10, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Damascus, Syria, Syria
    Thank you for your replay.
    A lot of my clients asked me directly to upgrade to php7 , some of them ask for that cos there application programmed with php7.
    Now , the problem that i have , there applications need "thread" to work in backgrounds without using "fork , exec ,popen" functions.

    Now it seem to be no option but compile php7 with ZTS. which i think cpanel has to provide as an option in WHM EasyApache .

    Compiling it by my self may not the best option since it may not be as Cpanel System required.

    So i kindly ask you to Ask your team stuff to provide such thing in WHM / EasyApache ASAP
     
    #3 mybeshoo, Sep 5, 2016
    Last edited: Sep 5, 2016
  4. mybeshoo

    mybeshoo Member

    Joined:
    Mar 10, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Damascus, Syria, Syria
  5. mybeshoo

    mybeshoo Member

    Joined:
    Mar 10, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Damascus, Syria, Syria
    Now new thing i understand it .. installing FASTCGI is the way how apachi work with php , but you still need to install
    Pthreads + ZTS , in order to code threads :)

    root@server [/home/mybeshoo/www]# php -v
    PHP 7.0.10 (cli) (built: Aug 25 2016 16:20:03) ( NTS ) <--------------
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    root@server [/home/mybeshoo/www]#

    But when i run :
    PHP:
    <?php

    class workerThread extends Thread {
    public function 
    __construct($i){
      
    $this->i=$i;
    }

    public function 
    run(){
      while(
    true){
       echo 
    $this->i;
       
    sleep(1);
      }
    }
    }

    for(
    $i=0;$i<50;$i++){
    $workers[$i]=new workerThread($i);
    $workers[$i]->start();
    }

    ?>
    Fatal error: Class 'Thread' not found in /home/<user>/public_html/test.php on line 3

    Correct me please
     
  6. mybeshoo

    mybeshoo Member

    Joined:
    Mar 10, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Damascus, Syria, Syria
    I think i am a bit confuse .
    • ZTS Enabled is : ( Thread Safety ) whish is not good thats is why FastCGI is installed to avoid using ( Thread Safety )
    • Then ! how for God Sake we will code Thread in php !
    It seems no way !
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The information in this document only pertains to cPanel & WHM version 56 and earlier. It's not recommended for use on cPanel 58. I advise against using these instructions, as they are not compatible with FPM support that's currently planned for cPanel version 60:

    Enhance FPM support

    Thank you.
     
Loading...

Share This Page