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

Allow setting custom PHP executable with parameters for server:run command #22101

Closed
tomasfejfar opened this issue Mar 21, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@tomasfejfar
Copy link

commented Mar 21, 2017

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 3.2.4
  • I'm using https://github.com/tomasfejfar/xdebug-wrappers if I need xdebug in any CLI app - practically a shortcut for php -dzend_extension=xdebug.dll
  • I'm using symfony console command server:run to start dev server
  • other usecase would be running the server with custom php.ini (php -c /path/to/ini)

Expectation:
If I run xdebug bin\console server:run CLI PHP is launched with xdebug extension enabled. So will the server.

Actual:
If I run xdebug bin\console server:run CLI PHP is launched with xdebug extension enabled. But not the server, because it reverse parses the php executable from runtime (i.e. runs php without the -d parameter).

Proposed solution:
Ideally I'd want the server to run using the very same command used to run the command. But that seems impossible from what I researched.
So the next best solution seems to be to allow passing the executable from outside in ServerRunCommand::createPhpProcessBuilder skipping \Symfony\Component\Process\PhpExecutableFinder::find() if it's defined.
I'll be happy to send PR if this makes sense to you.

@xabbuh xabbuh added this to the 3.x milestone Mar 22, 2017

@jsamouh

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2017

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Jul 28, 2017

@tomasfejfar would you like submitting a PR? That'd be for 3.4 on WebServerBundle

@tomasfejfar

This comment has been minimized.

Copy link
Author

commented Jul 30, 2017

I'll try to work on that and submit PR ASAP.

@tomasfejfar

This comment has been minimized.

Copy link
Author

commented Aug 7, 2017

The PR is ready, I hope ;)

@nicolas-grekas nicolas-grekas removed this from the 3.4 milestone Oct 8, 2017

@nicolas-grekas nicolas-grekas self-assigned this Dec 29, 2017

@nicolas-grekas nicolas-grekas removed their assignment Dec 29, 2017

fabpot added a commit that referenced this issue Dec 31, 2017

feature #25629 [Process] Make `PhpExecutableFinder` look for the `PHP…
…_BINARY` env var (nicolas-grekas)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[Process] Make `PhpExecutableFinder` look for the `PHP_BINARY` env var

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22101
| License       | MIT
| Doc PR        | -

I think this is enough to fix the linked issue and thus replace #23721.
ping @tomasfejfar FYI

Commits
-------

4bd01f2 [Process] Make `PhpExecutableFinder` look for the `PHP_BINARY` env var

@fabpot fabpot closed this Dec 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.