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

how to set php.exe path #1

Closed
ooing opened this issue Sep 13, 2017 · 12 comments
Closed

how to set php.exe path #1

ooing opened this issue Sep 13, 2017 · 12 comments

Comments

@ooing
Copy link

ooing commented Sep 13, 2017

No description provided.

@kokororin
Copy link
Owner

Try

"phpfmt.php_bin": "C:\\php\\php.exe"

@ooing
Copy link
Author

ooing commented Sep 13, 2017

thank

@acrolink
Copy link

or like this: "phpfmt.php_bin": "C:/php/php.exe". Thanks for the great work put into this library.

@mikerockett
Copy link

PHP should be in your PATH already, so just "phpfmt.php_bin": "php" will do...

kokororin added a commit that referenced this issue Oct 28, 2017
@shamseerahammedm
Copy link

i'm still getting the same error any solutions ?

"php.validate.executablePath": "C://Program Files//php//php.exe",
"phpfmt.php_bin" :"C://Program Files//php//php.exe",

this is how my file looks like

@kokororin
Copy link
Owner

@shamseerahammedm
microsoft/vscode#533

"phpfmt.php_bin" :"C:/Program Files/php/php.exe",
Or "phpfmt.php_bin" :"C:\\Program Files\\php\\php.exe",

@fgc0109
Copy link

fgc0109 commented Mar 6, 2018

maybe your PHP file path should not have any SPACE !!!
"C:/php/php.exe" worked , but "C:/Program Files/php/php.exe" not work
PHP的目录里不能有空格!!!

@Morgy93
Copy link

Morgy93 commented May 15, 2018

I'm getting:
phpfmt: php_bin "c:/php/php-7.2.5-Win32-VC15-x64/php.exe" is invalid

This works fine:
"php.validate.executablePath": "c:/php/php-7.2.5-Win32-VC15-x64/php.exe",

But this one does not:
"phpfmt.php_bin": "c:/php/php-7.2.5-Win32-VC15-x64/php.exe"

I already tried "c:/php/php.exe", but same error - maybe I need another php version?

@geniusunil
Copy link

Am i missing the obvious? where is this configuration file which contains the path of phpfmt.php_bin ?

@shamseerahammedm
Copy link

shamseerahammedm commented Mar 8, 2019

Am i missing the obvious? where is this configuration file which contains the path of phpfmt.php_bin ?

File>Preferences>Settings
from the window that comes when u choose settings, you need to search for "Edit in settings.json" click on that and over there you need to specify your php.exe file path
mine looks like this

{
 "phpfmt.php_bin": "\"C:\\Program Files\\php\\php.exe\"",
}

@shamseerahammedm
Copy link

shamseerahammedm commented Mar 8, 2019

I'm getting:
phpfmt: php_bin "c:/php/php-7.2.5-Win32-VC15-x64/php.exe" is invalid

This works fine:
"php.validate.executablePath": "c:/php/php-7.2.5-Win32-VC15-x64/php.exe",

But this one does not:
"phpfmt.php_bin": "c:/php/php-7.2.5-Win32-VC15-x64/php.exe"

I already tried "c:/php/php.exe", but same error - maybe I need another php version?

Its because you are using the wrong path format probably, this is what worked for me ( My php.exe file is in the php folder inside program files )

{
 "phpfmt.php_bin": "\"C:\\Program Files\\php\\php.exe\"",
}

@Serhioromano
Copy link

Serhioromano commented Jun 5, 2019

I have an error in output

6/5/2019, 7:07:48 PM
--------------------
Command failed: C:/OSPanel/modules/php/PHP-7.2-x64/php.exe -l  C:\Users\serhi\AppData\Local\Temp\temp-nldvkjje.php

When I run the same command in CMD it works. I've tried with \\ slashes too.

I have this also

"terminal.integrated.shell.windows": "C:\\Windows\\System32\\wsl.exe"

But if I change bin to php ro /usr/bin/php it also does not work although works in WSL terminal.

I want to use this formatter very match because of transformations, after PhpStorm I need those because i get used to them. And I do not want to reformat my old code, to make a mess in git.

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

9 participants