Skip to main content

php7 and Pthreads + ZTS

Comments

6 comments

  • cPanelMichael
    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.
    0
  • mybeshoo
    Could you provide some more information on why you prefer to use thread safety? Do certain applications fail when it's disabled?

    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
    0
  • mybeshoo
    Ok, i understand new thing, i need to seting php to be FAST-CGI. and use "non-thread-safe" . I did that using this DOC Configure PHP-FPM with User Pools for EasyApache 4 - cPanel Knowledge Base - cPanel Documentation Thanks Cpanel. Now how to install "non-thread-safe" to run thread via Command Line !
    0
  • mybeshoo
    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]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(); } ?> [/PHP] Fatal error: Class 'Thread' not found in /home//public_html/test.php on line 3 Correct me please
    0
  • mybeshoo
    I think i am a bit confuse . [LIST]
  • 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 !
  • 0
  • cPanelMichael
    Ok, i understand new thing, i need to seting php to be FAST-CGI. and use "non-thread-safe" . I did that using this DOC Configure PHP-FPM with User Pools for EasyApache 4 - cPanel Knowledge Base - cPanel Documentation Thanks Cpanel.

    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.
    0

Please sign in to leave a comment.