0

I’ve successfully installed PHPUnit, but I am running into some problems. When I try to run it on the command line, I get this message:


> “PHPUnit 8.0.4 by Sebastian Bergmann and contributors. This version of

PHPUnit is supported on PHP 7.2 and PHP 7.3. You are using PHP 7.1.23 (/usr/bin/php).”

When I type “php –v” in the command line, the system verifies that I’m using version 7.1.23 of the language.

When I tried to install PHP 7.3.2, Homebrew gives me the following message:

“Warning: php 7.3.2 is already installed, it's just not linked You can use brew link php to link this version."

When I try to link, it tells me:

"Linking /usr/local/Cellar/php/7.3.2... Error: Could not symlink sbin/php-fpm /usr/local/sbin is not writable.”

So PHP 7.3.2 does exist on my system, but PHPUnit is not detecting it. Would you happen to know of any fix for this? Is there a way to switch to 7.3.2, or to perhaps install an earlier release of PHPUnit that’s compatible with PHP 7.1.23?

Thanks in advance for any help you can give.

Amine KOUIS
  • 1,686
  • 11
  • 12
Tom
  • 19
  • 1
  • 1
    It looks like this is a homebrew issue, not a phpunit one - see the error: "Error: Could not symlink sbin/php-fpm /usr/local/sbin is not writable" – scrowler Mar 03 '19 at 22:54
  • 1
    You were on the right track and then you stopped. Fix the `brew link php` issue by setting the correct permissions -- google should help you. – noetix Mar 03 '19 at 22:54
  • 1
    Check out https://stackoverflow.com/questions/26647412/homebrew-could-not-symlink-usr-local-bin-is-not-writable – noetix Mar 03 '19 at 23:48
  • Thanks, Alex. So based on what I see there, It seems like I'd enter the following sequence of commands: "sudo chown -R $(whoami) $(brew --prefix)/* brew doctor brew prune brew link php@7.3" Does that seem right, or would I just use "sudo chown -R YOUR_COMPUTER_USER_NAME PATH_OF_FILE"? – Tom Mar 04 '19 at 00:53
  • Brew doctor shows me the following: "Warning: The following directories do not exist: /usr/local/sbin You should create these directories and change their ownership to your account. sudo mkdir -p /usr/local/sbin sudo chown -R $(whoami) /usr/local/sbin" – Tom Mar 04 '19 at 00:57

1 Answers1

-2

Maybe you should just try with sudo?

sudo brew link php

Edit: It's not a good idea. Please ignore.

tintinboss
  • 672
  • 1
  • 7
  • 25
  • 1
    Is using `sudo` here the recommended action by `brew`? – noetix Mar 03 '19 at 22:55
  • I don't see why not. Otherwise he will need to chown that directory. Isn't that the same? – tintinboss Mar 03 '19 at 22:58
  • I think running `brew doctor` can be a good idea to find out root cause – tintinboss Mar 03 '19 at 23:05
  • 2
    `Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.` –  Mar 03 '19 at 23:24