Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove php-config from /usr/local/opt/php/bin #372

Closed
josegonzalez opened this Issue · 17 comments

6 participants

@josegonzalez

Removing it would shut brew doctor up about whether or not homebrew-php is in compliance. I have a feel it might have to do with skip-clean. Is there any benefit to having this in the $PATH?

@mcdado

What's its purpose? I was checking here because of that warning that keeps showing up on brew doctor

@shrop

It looks like extensions could use the --with-php-config option if needed. This could allow php-config to be available, but not in the $PATH.

"When compiling extensions, if you have multiple PHP versions installed, you may specify for which installation you'd like to build by using the --with-php-config option during configuration, specifying the path of the respective php-config script." from http://php.net/manual/en/install.pecl.php-config.php

@walesmd

There's no indication this has to stay in $PATH; I kicked it over to /etc/php53-config to keep brew doctor happy for the time being.

@ablyler
Owner

@josegonzalez: Can this be closed? I don't have /usr/local/opt/php/bin on my system anymore.

@mcdado

I would also add that the problem arises when you add php/bin to the path, like so:
PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"

So maybe change the last note on brew info php5x to say "Only if..." or something like that? I would say that I initially did just because it was listed there.

@josegonzalez
Owner

If someone wants to fix the issue, go right ahead.

@mcdado mcdado referenced this issue from a commit in mcdado/homebrew-php
@mcdado mcdado Modify Extensions message to address Issue #372 fc059ca
@ablyler
Owner

Fixed via 87053f3.

@ablyler ablyler closed this
@ijy
ijy commented

Is this issue really solved? Although I know it's just a minor warning Homebrew itself encourages the use of brew doctor regularly to see that all is well. Whenever you run this command you really want to be seeing the "Your system is ready to brew." message.

I already had PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH" in my .zshrc file but it is this which produces the warning. If I remove it the warning disappears but then obviously it makes it pretty pointless to install PHP via Homebrew as I need to be using that config file and working with that version of PHP. I'm not talking about any extension compiling but just generally using PHP 5.5 which I installed via Homebrew (as opposed to the system default PHP 5.4 which it would fall back to if I remove the above line from my .zshrc file).

Can anyone suggest an alternative workaround which would remove the warning but still allow the use of PHP 5.5 installed via Homebrew? That's all that's required.

@mcdado
@ijy
ijy commented

I looked at the commit but couldn't see what's different about it. It seem to basically just set the message which tells you to add it to your PATH variable which I have as above. What symlink do you setup? I'm not doubt missing something obvious, sorry.

@mcdado

Well, the message in the commit refers to the line right under that message, because that PATH variable is slightly different that the one you have: PATH="#{HOMEBREW_PREFIX}/bin:$PATH" vs PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH".

From my understanding, the binaries are sylinked in {HOMEBREW_PREFIX}/bin, making unnecessary to include the bin directory that resides in php/php55, which contains that file. As a side effect, including that directory generates the warning.

@ijy

Ah I see. Thanks for the explanation. That makes sense and yes, using PATH="#{HOMEBREW_PREFIX}/bin:$PATH instead of PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH" does indeed remove the warning from brew doctor. It also shows that PHP 5.5.6 (Homebrew installed) is still in use.

Out of interest, I know you mentioned that the only issue would arise if multiple versions were installed but if PHP 5.6 came out and I wanted to install that via Homebrew how would I switch? I don't necessarily need to run them at the same time but more in the case of making the upgrade.

@mcdado
@ijy

Ah, easy. I presume if you wanted to link back to php55 again you'd just brew link php55 and it would set the symlink back up as it was before?

@mcdado
@ijy

Awesome. I can live with that. :) Thanks for the help and explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.