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.
Related
I downloaded MacOS Mojave and did a clean installation on my mid 2012 macbook Pro. Installed XCode with command line tools. Got native Apache and PHP working, with PEARL, PECL and last version of ICU (63.1) for later use of Intl extension.
But every attempt of Intl instalation has failed. Before the clean instalation, i found a intl.so on a pen drive and used ICU version 54, but isn't the best way to get things working for a development enviroment.
In the end, i'm stuck with PECL incapable of finish intall of Intl because can't find php_smart_str.h file.
I've reinstalled the developer tools header files too:
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
Is it possible to have a development enviroment without Homebrew?
When i run at the terminal:
sudo pecl install intl
Returns the following:
/private/tmp/pear/install/intl/intl_error.h:24:10: fatal error: 'ext/standard/php_smart_str.h' file not found
Right after creating libtool and running: make.
Ok, instead of using homebrew, i really wanted to use only native apache and php pre-installed on my MacBook Pro with Mac OS Mojave, trying to maintain the most clean development environment possible for CakePHP use.
So, on Pecl Official site ( https://pecl.php.net/package/intl ), it's clear that Intl package is not maintained anymore and has been superseded. Since PHP 5.3.0 you don't need to use Pecl to install intl extension, it's bundled with PHP.
But, it's missing on native instalation of PHP 7.1.24 on Mac OS Mojave.
Then i downloaded PHP 7.1 from php.net, installed XCode Command Line Tools, ICU (http://site.icu-project.org/), Autoconf, reinstalled the developer tools header files, and finally installed Intl extension using phpize.
Important: you'll have to disable SIP.
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
So, I'm trying to install the pcntl extension on my MacBook Pro (High Sierra 10.13.4).
I tried following the guides that I can find online, but they are all outdated, since Homebrew decided to move all php packages to their core, and delete some of them in the process.
(https://github.com/Homebrew/homebrew-php, WTF Homebrew?!)
The pcntl php extension is one of those packages.
This was done the end of March, so very recently. Nobody asked this question since then.
Is there any other way to install the pcntl extension on a Mac?
They didn't drop the extension they decided on compiling it with php by default.
While according to this brew formular it should be available in php71 it only is available starting with php72
Debian : 7.4
I have some difficulty to make ssh2 work with php5. i didn't find a solution on other topics and i search a LOT ! all has been well installed according to debian outputs but it still doesn't work.
This is what i'v done
Package installed :
- php5
- php5-dev
- libssh2-php
- libssh2-1-dev
I used PECL to install
pecl install -f ssh2
I just press enter for auto prefix.
And extension=ssh2.so to /etc/php5/apache2/php.ini
Restart more than one time apache2.
But the package ssh2 still not appear in output of php -m and says that ssh2_connect is undefined
I totally out of resources to make it works, so please can anybody helps me ?
Here some info provided by phpinfo() :
extension_dir /usr/local/lib/php/extensions/no-debug-non-zts-20100525/
extension version 0.12
libssh2 version 1.4.3
banner SSH-2.0-libssh2_1.4.3
If you need i can give more informations
I use phpseclib's libssh2-compatibility-layer to avoid having to install libssh2. You can use all the libssh2 functions without having it installed thanks to the use of phpseclib.
If you're writing your application from scratch maybe try just using phpseclib from the onset intsead of libssh2.
I tried to use idn_to_ascii() function with the pre installed PHP instance of Max OSX 10.9.4 (which is 5.4.24).
I read through lot of Stackoverflow questions and in the most of them they say: intl is precompiled since PHP 5.3 and you don't need an extension and it works out of the box.
But why are the intl functions not available in this PHP instance then? I just get a
Fatal error: Call to undefined function idn_to_ascii() in /path/test.php on line 3
Also I tried it with XAMPP 1.8.3-4 on OSX 10.9 with PHP 5.5.x and I also get
Fatal error: Call to undefined function idn_to_ascii() in /Applications/XAMPP/xamppfiles/htdocs/test.php on line 3
Is this a problem with OSX or are there problems with both instances of PHP?
intl is bundled with the PHP source code, but must be enabled using the --enable-intl compile-time option. This is apparently not the case for those two PHP installations. You can check using php -i | grep intl. You'll probably have to go with the PECL installation method. Alternatively I'd recommend maintaining your own flexible PHP installation with homebrew's homebrew-php tap.
The problem also occures on Debian 7.9 too and you can install php5-intl package with apt-get to solve it.
I had the same issue on my servers. Unlike the proposed solution here, I had PHP version 7. So I had to install the corresponding intl packages:
For PHP 7.1:
sudo apt-get install php7.1-intl
For PHP 7.0
sudo apt-get install php7.0-intl