Skip to content
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

Fails to detect latest PHP version (8.4) on Homebrew #1

Open
Thavarshan opened this issue Feb 15, 2025 · 5 comments
Open

Fails to detect latest PHP version (8.4) on Homebrew #1

Thavarshan opened this issue Feb 15, 2025 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Thavarshan
Copy link
Owner

Thavarshan commented Feb 15, 2025

Description

When running phpvm use 8.4, PHPVM fails to detect and use the latest version of PHP (8.4) on macOS when installed via Homebrew. This issue occurs because Homebrew installs the latest PHP version under the generic formula php (i.e., brew install php), rather than as a versioned package (e.g., [email protected]).

Steps To Reproduce

  1. Install the latest version of PHP using Homebrew:
    brew install php
  2. Verify that PHP is installed and running the expected version:
    php -v
  3. Try switching to PHP 8.4 using PHPVM:
    phpvm use 8.4
  4. Observe that PHPVM fails to detect and switch to PHP 8.4.

Expected Behavior

PHPVM should correctly detect and switch to the latest installed version of PHP, even when installed using the generic php formula in Homebrew.

Actual Behavior

PHPVM does not detect the latest version and fails to switch to PHP 8.4.

Potential Fix

  • Modify PHPVM to check for the generic php formula in Homebrew when a version like 8.4 is requested.
  • Add logic to determine the installed PHP version when brew install php is used.
  • Provide a fallback mechanism or alias for the latest PHP version when installed via Homebrew.

System Information

  • macOS Version: 15.3
  • Homebrew Version: 4.4.20
  • PHPVM Version: 1.1.0

Additional Context

Homebrew maintains the latest PHP version under php instead of specific [email protected] formulas. This makes it difficult for PHPVM to recognize the installed version unless it explicitly checks for php when determining available versions.

@Thavarshan Thavarshan added bug Something isn't working good first issue Good for newcomers labels Feb 15, 2025
@Thavarshan Thavarshan self-assigned this Feb 15, 2025
@Arnesh-pal
Copy link

I'd be happy to help!

@Thavarshan
Copy link
Owner Author

I'd be happy to help!

Any help would be greatly appreciated mate!

@Arnesh-pal
Copy link

I have php 8.4.4 in my mac
Do you want to use 8.4 only ?

@Thavarshan
Copy link
Owner Author

Since PHP 8.4 is the latest version, choosing it is causing the issue. Do you understand the problem?

@Arnesh-pal
Copy link

Ya I understood
Facing the same problem
Yet to find a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants