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

Bug: Spark issue with PHP install location #2367

Closed
yrneh-mi opened this issue Oct 27, 2019 · 7 comments
Closed

Bug: Spark issue with PHP install location #2367

yrneh-mi opened this issue Oct 27, 2019 · 7 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them documentation Pull requests for documentation only
Milestone

Comments

@yrneh-mi
Copy link

Bug?
If PHP is installed to a directory with a space in its name 'php spark serve' returns error: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

CodeIgniter 4 version
CodeIgniter 4.0.0.0-rc3

Affected module(s)
Running command 'php spark serve'

Expected behavior, and steps to reproduce if appropriate
Install and configure PHP (any version) to 'C:\Program Files\PHP' (any directory with a space in its name).
Execute command 'php spark serve'.
OR
Execute command '"C:\Program Files\PHP\7.3.10\php.exe" spark serve' (complete php path).

Context

  • OS: Windows 10 Pro 64bit
  • Web server: N/A
  • PHP version: 7.3.10
@yrneh-mi yrneh-mi added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 27, 2019
@jim-parry jim-parry added the documentation Pull requests for documentation only label Oct 27, 2019
@jim-parry jim-parry added this to the 4.0.0 milestone Oct 29, 2019
@lonnieezell
Copy link
Member

This is not an issue with spark. It is a Windows/PHP issue. See this SO post for examples of others having issues.

@EdgarEldy
Copy link

EdgarEldy commented Feb 29, 2020

I have experienced the same problem and it's still not resolved.
Whenever i run php spark serve it returns this error : 'C:\Program' is not recognized as an internal or external command' Any help ?
Capture

@MGatner
Copy link
Member

MGatner commented Feb 29, 2020

That screenshot was very helpful! This appears to be an issue with the call to PHP itself. I think we need to quote our passthru call to the PHP binary here:

		passthru($php . ' -S ' . $host . ':' . $port . ' -t ' . $docroot . ' ' . $rewrite, $status);

Reopening.

@MGatner MGatner reopened this Feb 29, 2020
@MGatner MGatner modified the milestones: 4.0.0-rc.4, 4.0.1 Feb 29, 2020
@EdgarEldy
Copy link

That screenshot was very helpful! This appears to be an issue with the call to PHP itself. I think we need to quote our passthru call to the PHP binary here:

		passthru($php . ' -S ' . $host . ':' . $port . ' -t ' . $docroot . ' ' . $rewrite, $status);

Reopening.

Which file ?

@MGatner
Copy link
Member

MGatner commented Feb 29, 2020

system/Commands/Server/Serve.php

MGatner added a commit that referenced this issue Feb 29, 2020
@EdgarEldy
Copy link

EdgarEldy commented Mar 2, 2020 via email

musmanikram pushed a commit to musmanikram/CodeIgniter4 that referenced this issue Mar 12, 2020
@mierol16
Copy link

mierol16 commented Nov 5, 2020

I can't solve this error. Anyone can help?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them documentation Pull requests for documentation only
Projects
None yet
Development

No branches or pull requests

6 participants