← Back to team overview

ius-coredev team mailing list archive

Re: [Question #271498]: PHP with Thread Safety enabled

 

Question #271498 on IUS Community Project changed:
https://answers.launchpad.net/ius/+question/271498

    Status: Open => Answered

bharper proposed the following answer:
I was just doing some additional testing and had the same line of
thinking:

# rpm -qa |grep php
php56u-xml-5.6.13-1.ius.centos6.x86_64
php56u-pecl-jsonc-1.3.9-1.ius.centos6.x86_64
php56u-pecl-pthreads-2.0.10-2.ius.centos6.x86_64
php56u-cli-5.6.13-1.ius.centos6.x86_64
php56u-common-5.6.13-1.ius.centos6.x86_64
php56u-5.6.13-1.ius.centos6.x86_64
php56u-pear-1.9.5-1.ius.centos6.noarch
php56u-pecl-jsonc-devel-1.3.9-1.ius.centos6.x86_64
php56u-process-5.6.13-1.ius.centos6.x86_64
php56u-devel-5.6.13-1.ius.centos6.x86_64


# zts-php -v
PHP 5.6.13 (cli) (built: Sep  3 2015 11:57:13) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies


# zts-php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mhash
openssl
pcntl
pcre
Phar
posix
pthreads
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

# zts-php -i |grep pthreads
/etc/php-zts.d/40-pthreads.ini
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
pthreads


# cat test-pthreads.php 
<?php
class AsyncOperation extends Thread {
  public function __construct($arg){
    $this->arg = $arg;
  }

  public function run(){
    if($this->arg){
      printf("Hello %s\n", $this->arg);
    }
  }
}
$thread = new AsyncOperation("World");
if($thread->start())
  $thread->join();
?>

# zts-php test-pthreads.php 
Hello World


The test-pthreads.php came from https://github.com/krakjoe/pthreads/blame/master/README.md#L57-L78.


-Ben

-- 
You received this question notification because your team IUS Core
Development is an answer contact for IUS Community Project.