New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All latest versions fail to build/install on OSX 10.14 Mojave #90
Comments
sorry for the ignorance. Mojave? |
It's the latest OSX version. I'm experimenting a bit as we speak to better understand what's going on. |
Ok for the time being I managed to get $ CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv) --with-readline=$(brew --prefix readline) --with-libedit=$(brew --prefix libedit) --with-tidy=$(brew --prefix tidy-html5)" phpenv install 7.2.10 and installing any missing package via homebrew. |
Is this effectively a dup of #77? |
No, I wouldn't say so. This to me sounds more like something completely messed up with the new OSX version, its command line tools and the path configuration. As far as I know we don't use homebrew to install php right? |
I see. On OSX I don't know the recommended way to install development dependencies though outside of using homebrew. Does this work without arguments / options if you |
I do think homebrew is pretty much the recommended way, or port for the old school people out there. I don't remember when was the last time I used something else than those two. No it doesn't, I should have specified that the needed dependencies are already installed, it's just that the |
By the log of 7.2.10 it looks like php-build needs custom configure options for the latest version. |
Which also reminds me I should search and read before commenting. The changes are already on their way in this PR |
The mcrypt thing is a non-issue although quite convenient. I can put in a php-build PR the zlib one though. |
@debo, could you try the osx-zlib branch from my php-build |
It goes on the right track but then it hits the next hurdle:
It really looks like the latest OSX version messed up path management and such. Also I checked your fix and I suppose it should be more specific and target OSX 10.13 and above. Your fork always worked find up until the previous version. |
@debo, the osx detection code wasn't mine, all I added was zlib detection. This worked on my friend's mac (I dont have one) immediately after a installing If not I basically have to add homebrew detection for each library it fails on to php-build. |
@madumlao I know it's not your code, I know that part of php-build quite well because I stared at it all yesterday 😄 What version of OSX he is running? I definitely have all those dips installed; this is my brew list
adns consul glib jsonlint libtasn1 memcached openssl@1.1 tbb
ansible coreutils gmp kops libtiff mercurial p11-kit telnet
apr cscope gmp@4 kubernetes-cli libtool mhash packer terraform
apr-util curl gnupg kubernetes-helm libunistring midnight-commander pcre terraform-inventory
augeas dialog gnutls lame libusb mpfr pcre2 tidy-html5
autoconf dos2unix go lemon libvo-aacenc mycli percona-toolkit tmux
automake eigen graphicsmagick libassuan libvpx mysql perl tree
aws-shell exercism graphviz libedit libxml2 mysql-client pinentry unixodbc
awscli expat hr libevent libxslt neon pkg-config utf8proc
bash ffmpeg htop libffi libyaml net-snmp pth vault
bison figlet hub libgcrypt libzip nettle python watch
bison@2.7 fontconfig icdiff libgpg-error libzzip node python3 webp
boost freetds icu4c libiconv lua nomad python@2 wget
bzip2 freetype ilmbase libidn2 luajit npth re2c x264
cask-repair gcc imap-uw libiodbc lz4 nspr readline xvid
ccache gd innotop libksba lzip nss rust xz
certbot gdbm isl libmagic lzlib numpy s-lang zeromq
cfssl geckodriver isl@0.12 libmemcached macvim oniguruma scons zlib
chromedriver gettext jasper libmpc make opencv speedtest-cli zsh
cloog gist jpeg libpng makedepend openexr sqlite zsh-completions
cmake git jq libssh2 mcrypt openssl subversion Don't worry, leave this one to me, I have a mac and I can investigate better I guess. I only opened the issue to keep track of it in case other people have the same problem. I can work on this 😉 |
I'll keep posted on this as I'm looking into adding a homebrew recipe as well. I'll also be using the osx-zlib branch to test some changes. |
I upgraded OSX and met same issues. I think this is the Mojave's issue. Homebrew/homebrew-core#29176 and https://stackoverflow.com/questions/50780183/cannot-install-brew-on-mojave-with-xcode10 was described details. Perhaps, the reason is no appearance of any Command Line Tools updates for Mojave. I resolved this issues by Homebrew/homebrew-core#29176 (comment) (or you can install manually. run $ xcode-select --install
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
$ env "PATH=/usr/local/opt/bison/bin:$PATH" "PHP_BUILD_CONFIGURE_OPTS=--with-openssl=$(brew --prefix openssl) --with-libzip" phpenv install 7.2.9 We should share this problems to php-build. |
@mizunashi-mana , does the above work if you skip adding AFAIK it's not necessar yon previous versions of osx as php-build itself should detect openssl |
@madumlao macOS uses libreSSL (which is older version). However, PHP requires OpenSSL. So, we should install openssl manually for php-build on macOS. In my case, I use Homebrew to install one. More details, If I install PHP by php-build without any flags, I get below errors: $ phpenv install 7.2.9
...
[Info]: Appending build output to /tmp/php-build.7.2.9.20181014193936.log
[Info]: Loaded extension plugin
...
[Preparing]: /var/tmp/php-build/source/7.2.9
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: WARNING: unrecognized options: --with-mcrypt
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: ).
configure: error: Cannot find OpenSSL's <evp.h>
-----------------------------------------
The full Log is available at '/tmp/php-build.7.2.9.20181014193936.log'.
[Warn]: Aborting build. And with
I agree, but I think it is difficult to cover all platforms. P.S. |
Yes, what I mean is, php-build itself will force the usage of homebrew openssl AFAIK. In addition, my current osx branch of php-build is being worked on to ensure that every such library that we need to force to use the homebrew version is also configured as such. Here's the homebrew detection code in the original if is_osx && [ "$(osx_major)" -eq 10 ] && [ "$(osx_minor)" -ge 11 ] && [ -n "$(which brew)" ] && [ -e "$(brew --prefix openssl)" ] && [ -e "$(brew --prefix libxml2)" ]; then
configure_option -R "--with-openssl" "$(brew --prefix openssl)"
configure_option -R "--with-libxml-dir" "$(brew --prefix libxml2)"
fi So basically it forces homebrew openssl if both openssl and libxml2 are installed. Given that:
are added, can you test the installation without the PHP_BUILD_CONFIGURE_OPTS that forces openssl? Your workaround basically puts homebrew on Mojave at parity with homebrew on previous versions of osx. I want to make sure at least just that part works in that case.
If you encounter errors with the above (after ensuring openssl and libxml2 are installed), can you test on my current osx development branch madumlao/phpenv#osx-zlib ? I'm putting some improvements in the homebrew library detection code there. Almost any other change needed for osx is just going to be of the same form as "do we have the homebrew version? if so add to configure..." so I want to make sure those parts work.
See above, the build script in php-build itself has special code for detecting the presence of osx and homebrew. I think you encountered a php-build bug, and I'm working on some PRs for that. |
@madumlao I see. I didn't know that homebrew detection codes already exists in php-build. However, https://github.com/madumlao/php-build/tree/osx-zlib seems to be too customized for me. I tests https://github.com/madumlao/php-build/tree/osx-zlib, when I have times. By the way, we should create new issue for brew detection on php-build because I think https://github.com/madumlao/php-build/tree/osx-zlib is not related this issue. If there are some people meets Mojave issue, they get confusing when they see this thread. And, we should discuss to support Mojave without zlib/bzip2 of Homebrew on this issue. |
@mizunashi-mana, I still need to know - does the compile work if you have both openssl and libxml2 installed via homebrew? I need to know to find out how deep this hits as I also need to line up some PRs for OSX. |
@madumlao I will report #90 (comment) on php-build/php-build#538, because I think this is not related Mojave's issues. For @madumlao and all of phpenv/php-build users, I summarize my research:
|
@madumlao installing those library doesn't fix it, as I mentioned earlier they just don't get detected anymore, not even if you manually run a @mizunashi-mana thanks for sharing all those links, I do still wonder why the homebrew libraries are not picked up though considering that in my system for example the brew path has precedence on all the others. Also it's curious to see that in my case I'm not having issues with openssl itself but other libs. Go figure. |
@debo, this is actually why I'm clarifying it. Furthermore, from the looks of the Mojave policy, php-build / ruby-build will need to be updated with detection for libraries specifically used by php and ruby during the build process. Again for clarity: homebrew libraries are not installed in a standard location and are unlikely to be picked up by the It's not really a herculean task as I basically have to search for all the |
@madumlao I didn't have a look at the code itself yet, and with code I mean the php-build one or even the actual Either ways if you think we should go about it by adding all the additional options in phpenv for the time being I'm more than happy to take up that task, so let me know please. |
Hi @hanachan1026 thanks for the report! Could you try below line? env LDFLAGS="-L$(xcrun --show-sdk-path)/usr/lib/system" phpenv install 7.2.9 And, could you give the content of Probably, this is the bug of PHP (not phpenv's), and it happens on all version but not only Mojave. |
Hi @mizunashi-mana thank you for your advice. I tried that line and I got a log below
So, maybe I should check out the php website. Thank you. |
@hanachan1026 Hmm... I think https://bugs.php.net/bug.php?id=73943 is just one. Probably, PHP cannot find the location of zip library bundled by XCode on your macOS.
If you update php-build plugin and rerun: xcrun --show-sdk-version
xcrun --show-sdk-platform-version
env LDFLAGS="-L$(xcrun --show-sdk-path)/usr/lib/system -L$(xcrun --show-sdk-platform-path)/usr/lib/system" phpenv install -v 7.2.9 then paste the log on this issue, I may help more. |
If you have libzip of Homebrew, this may work. env "CONFIGURE_OPTS=--with-libzip=$(brew --prefix libzip)" phpenv install 7.2.9 And, please check whether exists
But, because I am not professional for macOS, above comments perhaps include some wrong. |
@mizunashi-mana |
@hanachan1026 next time I suggest you create a gist for logs that long. One thing that was previously mentioned and it's still relevant and needed is the fact Mojave moved its libraries headers to a different location, causing many tools that are depending on them to fail. If you didn't already please make sure you execute the following commands: $ xcode-select --install
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / And in case you want more context please scroll back in this thread and you will find additional infos. Please let us know if that helps. |
@debo Sorry for tha late reply. I still get the same error with those commands, and I read all this thread and php-build issue, so I think I'll wait for the php bug fix report for Mojave. |
@hanachan1026 I'm afraid but I'm sort of bearer of bad news. 7.2.9 build fine for me as you can see from the following output: [Info]: Loaded extension plugin
[Info]: Loaded apc Plugin.
[Info]: Loaded composer Plugin.
[Info]: Loaded github Plugin.
[Info]: Loaded uprofiler Plugin.
[Info]: Loaded xdebug Plugin.
[Info]: Loaded xhprof Plugin.
[Info]: Loaded zendopcache Plugin.
[Info]: php.ini-production gets used as php.ini
[Info]: Building 7.2.9 into /Users/debo/.phpenv/versions/7.2.9
[Skipping]: Already downloaded and extracted https://secure.php.net/distributions/php-7.2.9.tar.bz2
[Preparing]: /var/tmp/php-build/source/7.2.9
[Compiling]: /var/tmp/php-build/source/7.2.9
[xdebug]: Installing version 2.6.1
[Skipping]: Already downloaded http://xdebug.org/files/xdebug-2.6.1.tgz
[xdebug]: Compiling xdebug in /var/tmp/php-build/source/xdebug-2.6.1
[xdebug]: Installing xdebug configuration in /Users/debo/.phpenv/versions/7.2.9/etc/conf.d/xdebug.ini
[xdebug]: Cleaning up.
[Info]: Enabling Opcache...
[Info]: Done
[Info]: The Log File is not empty, but the Build did not fail. Maybe just warnings got logged. You can review the log in /tmp/php-build.7.2.9.20181230225107.log or rebuild with '--verbose' option
[Success]: Built 7.2.9 successfully. I'm running the latest mojave and this is the output of my And the following is my actual export path: export PATH="$HOME/bin:$GOPATH/bin:/usr/local/share/dotnet:/usr/local/bin:/usr/local/sbin:/usr/local/opt/ccache/libexec:/usr/local/opt/bison/bin:$PATH" I hope it helps. |
sup guys, I may start active work on this soon if this hasn't yet been resolved. |
@madumlao I don't know, we didn't hear back from @hanachan1026 so maybe resolved... let's see if they get back to us |
Well actually I gave up using phpenv though, when I tried installing
php7.○.○ recently I still got the same error
2019年4月15日(月) 17:22 debo <notifications@github.com>:
… @madumlao <https://github.com/madumlao> I don't know, we didn't hear back
from @hanachan1026 <https://github.com/hanachan1026> so maybe resolved...
let's see if they get back to us
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKKazSu8k_Nirsw3iVfLttsd5KyGxuC8ks5vhFLugaJpZM4XVkpt>
.
|
I see, that's a shame. Did you try to match your configuration to mine though? Do you have the same brew packages? |
See php-build/php-build#543 (comment) . I'm trying to create patch, but that's difficult job and I'm busy recently, so my work is delayed. PR is welcome. |
Parallel to @mizunashi-mana 's effort, I've put a little more into my previous php-build#osx-zlib branch branch and I've gotten at least 7.2.x and 7.1.x building on Mojave + XCode 10.2, however I haven't yet gotten libtidy to work and 7.0.x complains of gmp issues. I'll need to integrate his patches into it to try as they go deeper into the heart of the problem which is PHP's build scripts. |
At this point I am not sure what became different on my machine but I don't have these issues anymore... 😢 |
macOS 10.15 Catalina $ brew install autoconf bison bzip2 curl icu4c libedit libjpeg libiconv libpng libxml2 libzip openssl re2c tidy-html5 zlib
$ PATH="$(brew --prefix icu4c)/bin:$(brew --prefix icu4c)/sbin:$(brew --prefix libiconv)/bin:$(brew --prefix curl)/bin:$(brew --prefix libxml2)/bin:$(brew --prefix bzip2)/bin:$(brew --prefix bison)/bin:$PATH" \
PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-bz2=$(brew --prefix bzip2) --with-curl=$(brew --prefix curl) --with-iconv=$(brew --prefix libiconv) --with-libedit=$(brew --prefix libedit)" \
phpenv install 7.3.9
$ php -v
PHP 7.3.9 (cli) (built: Sep 10 2019 17:45:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies |
Thanks @naviapis that worked a treat |
Someone already mentioned PHPBrew but here is their issue and their fix phpbrew/phpbrew#966 |
To get PHP 7.1.32 to build on Mojave I needed this configuration: env PATH="$(brew --prefix icu4c)/sbin:$(brew --prefix libiconv)/bin:$(brew --prefix curl)/bin:$(brew --prefix libxml2)/bin:$(brew --prefix bzip2)/bin:$(brew --prefix bison)/bin:$PATH" CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-bz2=$(brew --prefix bzip2) --with-curl=$(brew --prefix curl) --with-iconv=$(brew --prefix libiconv)" PHP_BUILD_CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl@1.1)" phpenv install 7.1.32 That's with openssl@1.1 installed and openssl@3 NOT installed. I also needed to patch
This was the patch:
|
why not mention this configure options on documentations |
On MacOS 13.4 Ventura this appears to still be an issue. I tried a number of the suggested solutions but ended up just uninstalling phpenv. |
|
Do you remember what commands you were running and what error you were getting? |
@debo I see this issue over in |
@bensaufley yes the plain command definitely won't work, that's known. In my case, given the listed brew packages are installed, the following commands work without issues for example: PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-bz2=$(brew --prefix bzip2) --with-curl=$(brew --prefix curl) --with-iconv=$(brew --prefix libiconv) --with-libedit=$(brew --prefix libedit) --with-tidy=$(brew --prefix tidy-html5)" phpenv install 8.1.11 If you would be so kind to give it one more try, time permitting, I will be more than happy to try to find out the actual culprit. As per the issue you linked, yes that's one but if you look there are few more on their GitHub, some more recent than that and we are not sure when and if it will addressed. The current state of things and the reason |
I tried to install the latest versions available on php-build but without luck. I tried to install:
and they all come back with
or
depending by the version.
Command Line Tools are installed and they are up to date, definitely something to investigate further.
The text was updated successfully, but these errors were encountered: