configure zts on mac+xampp - php

I need to use pthread in one of my project and I am using XAMPP on mac. When I try to install pthread using this commend "sudo pecl install pthreads", I get this error "pthreads requires ZTS, please re-compile PHP with ZTS enabled". I tried to google about enabling zts on mac+xampp, but there is not much help. Almost every topic says to reinstall php version with zts enabled. But there is not much help available. Please help.

Related

How to download PHP -thread safe now that Homebrew no longer support --with-thread-safety?

I need to use PHP pthreads on Mac OS High Sierra, but Homebrew is no longer supporting downloads of PHP --with-thread-safety.
How do I get and install a thread safe version of PHP for Mac OS, Php v7.1.16 without homebrew?
If it is going to have to be some sort of manual install - does anyone have step by step directions for the mac or know where I can get instructions?
I have been looking on the internet for instructions for 5 hours now. I'm tired and can't believe that no one has any posted info on this.
I was able to get PHP 7.2.5 installed on Mac OS HighSierra with ZTS/Thread safety by using phpbrew.
Install Steps I took:
Downloaded phpbrew from http://phpbrew.github.io/phpbrew/ and installed with their directions. Please note at the end of the installation, they give you further instructions for setting up your ~/.bashrc to load phpbrew, look for them at the terminal.
Once you have phpbrew running you are ready to install php with zts by using the command below (of course you can install all of the extensions that you like by checking the installation for extension instruction)
phpbrew install php-7.2.5 +openssl='/usr/local/opt/openssl/' -- --enable-maintainer-zts --with-curl=/usr/local/
It is important to have openssl and curl already installed before installing php and you must point to their location on your computer at the install line as I have done above. You can add all the extensions you need, but you must have the openssl and curl because I had a ton of problems with installation without them. But you could try omitting.
For those of you who are using PHP ZTS so that you can go on to install pthreads --ONLY PHP 7.2 and above works with Krakjoes pthread-master which you can download and follow the installation at https://github.com/krakjoe/pthreads

PHP7.2 ZTS + PThreads on Ubuntu 16.04; Install additional packages

I have a test server running Ubuntu 16.04. I managed to compile PHP 7.2.2 with ZTS from source and installed PThreads on it.
Now, how do I proceed with further setting up PHP without damaging my installation? If I try to install, let's say PHP Curl or Apache's PHP 7.2 module, Ubuntu wants me to install php7.2-common, etc. which would overwrite my current installation.
Is there a safe way to install additional PHP modules and hook up PHP with Apache2?
Thank you in advance!

Installing PHP 7.2 thread-safe on a mac

I'm trying to install PHP 7.2 thread-safe on a mac (Sierra 10.13).
I've tried:
with homebrew, using the --with-thread-safety option, but it's not recognized anymore
recompiling PHP with the --with-tsrm-pthreads option passed to ./configure, but failed
brew install php72 --with-thread-safety Warning: php: this formula has no --with-thread-safety option so it will be ignored!
Any suggestion?
In the end, I solved installing it through phpbrew.
Homebrew has started a migration of PHP related formulaes a while ago, so most of the parameters on most of the guides will not work anymore until someone will add support for them to the formulae.
Also, for most of the packages from now on Brew team recommends to use PECL.
You can try to build with flag --enable-maintainer-zts that should enable thread safety, it actually has worked out for me.

please re-compile PHP with ZTS enabled Mac OS X

I trying to install pthreads on Mac Os X.
When I execute:
sudo pecl install pthreads
I get error:
checking checking for ZTS... configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled
ERROR: `/private/tmp/pear/temp/pthreads/configure' failed
So the question is how to recompile php with ZTS enabled for OS X?
I suggest you don't recompile OS X native php. Instead build and install new thread-safe version to different location.
If you use homebrew you should install it with -with-thread-safety option.
If you prefer to build it manually add --enable-maintainer-zts option to configure script.
Sadly Homebrew is not supporting the thread-safe version anymore: https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb#L56

Configuring PHP for pthreads

I am trying to install pthreads for PHP, which is here.
In PHP manual of extention it says:
To enable pthreads support, configure PHP with --enable-maintainer-zts
and --enable-pthreads.
I have a CentOS server which has PHP installed but I cant figure out how to reconfigure it with these settings on, I checked my phpinfo() can see current ./configure options.
I will happy if someone can show me how to reconfigure my php. Do I need to uninstall current PHP first then install another or is there any way to run this ./configure command easily. I have SSH access to my server.
You could try install using PECL:
http://pecl.php.net/package/pthreads.
How to install PECL extensions:
http://php.net/manual/en/install.pecl.php
pecl install pthreads
I've written a tutorial about exactly this - Compile PHP with pthreads and ZTS enabled.
You must compile PHP as there are no prebuilt packages.
To reconfigure everything you'd use ./configure mainly.
if centos does not provide a thread safe version, you must compile php by own.
You have to build pthreads for your centos op system. After that you can use it as extension...
Use the following tutorials
http://blog.slowbro.org/2013/08/compiling-php-55-with-pthreads-on-centos/
http://eddmann.com/posts/compiling-php-5-5-with-zts-and-pthreads-support/
Or simply read the manual...
http://www.php.net/manual/en/pthreads.installation.php

Categories