There is a homebrew-php repo that Linuxbrew does not have a fork of. I am currently installing the homebrew version after tapping it, but I had to make a modification to build on Linux. I would like to contribute it to the Linuxbrew group.
First of all, thanks for offering to contribute your fix to Linuxbrew :smile_cat:
homebrew-php is not currently supported. I've used a few of the formulae, like composer, with a system PHP before without major issues, but it's not supported either.
I would be _very_ happy to see it supported though. Easier availability of modern PHP versions (rather than outdated 5.3's and 5.4's) is nothing but a good thing.
My concern is that we currently lack the time necessary to properly support it, so I'm not ready to fork homebrew-php just yet.
I don't expect upstream will accept the modification, so my recommendation for now is to keep a fork of homebrew-php, but @sjackman might have a better suggestion.
@ablyler @javian Would you accept patches to Homebrew/php that allow the formulas to build on Linuxbrew?
@sjackman I'm for it and the only concern that I might have is the recent changes we made to require the httpd package to build on macOS Sierra but feel free to put in a proposal and we can have a look at it.
That's excellent news, Javian. I don't use PHP myself, so I won't be the point person on this project, but I'm happy to answer questions and give opinions on any Linuxbrew questions about the PHP packages. Just tag in the question.
@carlorosati Would you like to submit a PR with your modifications to homebrew/php?
Sure. how would I make my changes? What if the settings for Linux and Mac are different? Do I need to wrap my changes in an if statement that tests for Linux? What's the standard procedure for this?
Make the code portable so that it works on both Mac and Linux if possible. Use if OS.mac? and if OS.linux? as necessary but preferably sparingly.
--enable-dtrace is enabled by defualt. This causes the build to fail on Linux if dtrace is not installed.
Would you rather
dtrace does not currently have a formula for Linux. Would you be interested in creating a formula for https://github.com/dtrace4linux/linux?
Either add dtrace as a formula dependency or wrap --enable-dtrace unless OS.linux? are reasonable solutions.
Sure, I'm game.
EDIT:
Nevermind. You need sudo to install dtrace.
I expect that you need sudo to load the dtrace kernel module. Is it possible to build and install the dtrace client libraries without sudo? Note that I'm not terribly familiar with dtrace.
I would vote for wrapping dtrace in OS.mac? for now
Works for me.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
@sjackman @carlorosati has this ever been resolved? Trying to brew install php72 but it fails:
configure: error: Cannot find sys/sdt.h which is required for DTrace support
@black-snow Hi, Roland. Homebrew/php is not a supported tap of Linuxbrew. You may, if you like, submit a PR to https://github.com/Homebrew/homebrew-php to add support for Linux to php72.
Also, I think that most of the content of the pho tap is being migrated to homebrew core. But I do not known how far they went.
We've not merged the first formula yet but its in the works. The aim is to retire the php tap before the summer and merge what's necessary in to core see https://github.com/Homebrew/homebrew-core/pull/16067 .
In fact I'd like to help. Not sure how to start, though @sjackman
@javian Is the person to ask about PHP.
I think it will be easier when some php formulae have been migrated to core.
I got a successful build of php on Linuxbrew by using --with-phpdbg because it disable dtrace on ./configure: https://github.com/Homebrew/homebrew-php/blob/master/Abstract/abstract-php.rb#L379
brew install --with-phpdbg --without-ldap php72
Thanks for the workaround, Emilien.
Most helpful comment
I got a successful build of php on Linuxbrew by using
--with-phpdbgbecause it disable dtrace on./configure: https://github.com/Homebrew/homebrew-php/blob/master/Abstract/abstract-php.rb#L379