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

Valet Stop throws an error DomainException: Unable to determine PHP service name #422

Open
sohailahmad07 opened this issue Aug 15, 2023 · 4 comments

Comments

@sohailahmad07
Copy link

Basic info

Distro (Name and version) PHP Version Valet version
Ex:Ubuntu 22.04 8 .2.8 2. 3.7
  • [ *] I've checked the issue queue and could not find anything similar to my bug.
  • [ *] I'm on the latest version of valet-linux (valet --version): <Valet-Linux-Version>
  • [ *] I've run valet fix (get Command "fix" is not defined. ) and valet install after updating and before submitting my issue/feature.

What is the problem?
A description of what you think the problem is.
i updated laravel install to 5.0.2 in which updated some of the composer dependence after that
valet Linux throws this error when i stop it

valet start is fine but why it can stop the server valet stop throws that error

DomainException: Unable to determine PHP service name. in /home/sohail/.config/composer/vendor/cpriego/valet-linux/cli/Valet/PhpFpm.php:418
Stack trace:
#0 /home/sohail/.config/composer/vendor/cpriego/valet-linux/cli/Valet/PhpFpm.php(362): Valet\PhpFpm->fpmServiceName()
#1 /home/sohail/.config/composer/vendor/cpriego/valet-linux/cli/includes/facades.php(28): Valet\PhpFpm->status()
#2 /home/sohail/.config/composer/vendor/cpriego/valet-linux/cli/valet.php(146): Facade::__callStatic()
#3 [internal function]: Silly\Application->{closure}()
#4 /home/sohail/.config/composer/vendor/php-di/invoker/src/Invoker.php(74): call_user_func_array()
#5 /home/sohail/.config/composer/vendor/mnapoli/silly/src/Application.php(95): Invoker\Invoker->call()
#6 /home/sohail/.config/composer/vendor/symfony/console/Command/Command.php(324): Silly\Application->Silly{closure}()
#7 /home/sohail/.config/composer/vendor/symfony/console/Application.php(1063): Symfony\Component\Console\Command\Command->run()
#8 /home/sohail/.config/composer/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#9 /home/sohail/.config/composer/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#10 /home/sohail/.config/composer/vendor/cpriego/valet-linux/cli/valet.php(408): Symfony\Component\Console\Application->run()
#11 {main} is stopped...

What was supposed to happen?
A description of what you think was supposed to happen.

i should stop the PHP server

What actually happened?
A description of what actually happened.

How to reproduce this?
A step by step guide on how to reproduce this issue.

What is the solution?
A description of the proposed solution.

Sources
All sources related to the bug. If the bug uses external tools like PHP extensions it should at
least contain a link to the tool. Any other media which proves helpful can be included here.

@josegus
Copy link

josegus commented Aug 20, 2023

Same on Ubuntu 22.01 and php-8.1.

Valet works, it's just the valet status command returning that DomainException.

I've also installed php-8.2 but I currently using php-8.1

@lucazsvn
Copy link

lucazsvn commented Sep 2, 2023

Same issue.

Ubuntu version: 22.04.6 and 23.04
PHP Version: 8.1 and 8.2.9
Valet version: 2.3.7

Additionally, I tried installing Valet Linux Plus. It works.

@sohailahmad07
Copy link
Author

sohailahmad07 commented Sep 4, 2023

any one having the same issue it can be fixed by going to .config/composer/vendor/cpriego/valet-linux/cli/Valet/PhpFpm.php

and replace your getFpmServiceNames Method with below code for me it on line 388

public function getFpmServiceNames()
    {
        if(is_null($this->version)) {
           $this->version = $this->getPhpVersion();
        }
        
        return [
            "php-fpm",
            "php-fpm{$this->version}",
            "php{$this->version}-fpm",
        ];
    }

@ilhamprabuzakys
Copy link

if(is_null($this->version)) {
$this->version = $this->getPhpVersion();
}

    return [
        "php-fpm",
        "php-fpm{$this->version}",
        "php{$this->version}-fpm",
    ];

work like a charm
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants