please re-compile PHP with ZTS enabled Mac OS X - php

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

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

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.

How do I install PHP with openssl on Mac High Sierra?

I'm using Mac High Sierra. I want to install PHP 7.2 with the openssl extension. I have openssl installed
localhost:php-7.2.1 davea$ brew install openssl
Warning: openssl 1.0.2n is already installed
However, when I run the PHP configure command (I'm building it from source), it eventually dies with the below error
localhost:php-7.2.1 davea$ ./configure --with-gmp=/usr/local --with-openssl --with-openssl-dir=/opt/local/bin
...
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for RAND_egd... no
checking for pkg-config... /usr/local/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
How do I tell PHP where that library is or rather how do I install it somewhere on my Mac?
ps - The reason I'm not installing PHP with homebrew is because homebrew does not support installation of PHP with GMP, which I need.

configure zts on mac+xampp

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.

MAC homebrew php pdo firebird driver

I installed php53 on mac osx with homebrew. I need to enable pdo driver for firebird.
I tried to instal via pecl ..
I donwload http://pecl.php.net/package/PDO_FIREBIRD
and compile this but I get this error
...
...
configure: error: libgds or libib_util not found! Check config.log for more information.
I found that means that I don't have installed firebird develepoment libraries...
I have installed firebird 2.0 on my mac.. this version is working Flamerobin.
Does anyone have pdo firebird driver on mac server installed via homebrew?
Pdo Firebird from pecl is deprecated , i will updated it soon that i get access to it
you need to download the source code for php extract it and then build only the pdo_firebird extension
cd ext/pdo_firebird
phpize
./configure
(you might need to pass the firebird framework dir --with-pdo-firebird=/Library/Frameworks/Firebird.framework )
make
sudo make install
after that you need to copy the extension in your brew build php extensions folder and add it to php.ini
extension=pdo_firebird.so
I also recommend firebird 2.5.x is more recent and well supported on recent macosx versions
I've solve this issue by :
sudo ln -s /Library/Frameworks/Firebird.framework/Versions/A/Firebird /usr/local/lib/libfbclient.dylib
macOS High Siera 10.13.3

Categories