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

Could not find 'php'. The program may not be installed. #1016

Closed
ghost opened this issue Jun 11, 2016 · 9 comments
Closed

Could not find 'php'. The program may not be installed. #1016

ghost opened this issue Jun 11, 2016 · 9 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 11, 2016

When I try to beautify a php file I get the error message "Could not find 'php'. The program may not be installed."

I already set the path to the php-cs-fixer.phar in the package settings. I also set the path to php in my windows system path variable. If I type "php -v" on the command line i get my php version and if I type "where php" i get the path to php. So php seems to work properly.

I am also using the php linter atom package and there is no problem with finding php.

@QiiSyhx
Copy link

QiiSyhx commented Jun 12, 2016

i have the same problem.
error info.
Could not find 'php'. The program may not be installed.
See http://php.net/manual/en/install.php for program installation instructions.
Your program is properly installed if running 'where.exe php' in your CMD prompt returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable.
Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=php&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help.

@ghost
Copy link
Author

ghost commented Jun 17, 2016

The problem could be that the windows system PATH variable is not correctly passed to atom. Maybe it would be a good idea to have an option in the atom beautify settings where the path to php can be set manually (like the path to php-cs-fixer.phar).

However, I am also using the php linter package and there I do not need to set the path to php (although I would have the option to do so).

@QiiSyhx
Copy link

QiiSyhx commented Jun 22, 2016

i have used php-fmt instead.

@ethanclevenger91
Copy link

Also getting this error. Attempted to add the debug but it just copied e to my clipboard.

Here's the stack trace:

Error: Could not find 'php'. The program may not be installed.
    at PHPCSFixer.module.exports.Beautifier.commandNotFoundError (file:///C:/Users/Ethan/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:196:14)
    at file:///C:/Users/Ethan/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:292:25
    at tryCatcher (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:502:31)
    at Promise._settlePromise (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:559:18)
    at Promise._settlePromise0 (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:604:10)
    at Promise._settlePromises (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:679:18)
    at Async._drainQueue (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:138:16)
    at Async._drainQueues (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:148:10)
    at Async.drainQueues (C:\Users\Ethan\.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:17:14)
    at process._tickCallback (node.js:392:9)

@UziTech
Copy link
Contributor

UziTech commented Jul 7, 2016

check out issue #1054. Might solve it

@ghost
Copy link
Author

ghost commented Jul 10, 2016

Thank you very much. That indeed solved the problem. The systems environment variable PATH has to be in uppercase.

I am a little worried that my change from "path" to "PATH" could have some unwated effects, but it seems that in Windows system variables are case insensitive.

I also still think it might be a good idea to have an option in the atom-beautify settings where the path to php can be set manually.

@ghost
Copy link
Author

ghost commented Jul 10, 2016

I found another problem.

When I open atom via the shortcut on my desktop, beautification works fine.

However, when I right click on a folder in explorer and select "Open with Atom", beautification simply does not happen. There is no error message, I can see the "beautification in progess" window, but the code stays as ugly as it is.

@prettydiff
Copy link
Collaborator

@joergmold That sounds like it should be a new and unrelated issue.

@Glavin001
Copy link
Owner

I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance.

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

No branches or pull requests

5 participants