php error spawn php enoent

Error: spawn php-cgi ENOENT #17

Comments

thinkholic commented Dec 17, 2016

I am getting this error message when I tried run a php script with this;

Appreciate if one has an idea what cause this error. 🙂

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

AlexBezuska commented Jan 18, 2017

I am getting this same error, I am trying to use this module to serve a wordpress site locally on mac osx.
I have php-cgi installed via homebrew on mac,

FrenchMajesty commented Feb 13, 2017

Yea same here, I have PHP installed via homebrew on Mac but still get the same error.

Ludovic42 commented Sep 6, 2017

`/node_modules/sphp$ node example.js
events.js:160
throw er; // Unhandled ‘error’ event
^

Error: spawn php-cgi ENOENT
at exports._errnoException (util.js:1020:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
`

kidBrazil commented Nov 2, 2017

For what its worth, I was able to get the error to go away by doing

SamukaDEV commented Jul 11, 2018 •

Ive solved this error on my MacOS High Sierra, simply appending a full-path to php-cgi:

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

I think this error is cause the node-php\main.js[child.spawn] isnt finding the php-cgi by $PATH

Note: i have tried all kind of installations of php and different versions, but the error has persist, then i solved with the full-path(solution of image) in node-php version 0.0.1

Источник

spawn ENOENT #6

Comments

Cipa commented Aug 15, 2014

Just installed and the console opens every time I open a php file.

Here is what I see when I start atom by clicking index.php in a project.
Atom 0.122.0/ MaxOs 10.9.4

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

dmnd commented Aug 18, 2014

See common errors, and if you think your problem is new then reply and I’ll reopen this issue. I’m betting it’s steelbrain/linter#150 though. You do have phpcs installed, right?

Cipa commented Aug 21, 2014

I have phpcs installed

and the problem seems like it’s similar to the one you mentioned
I get an Uncaught Error: spawn ENOENT

dmnd commented Aug 21, 2014

Did you try opening Atom from the command line as described in steelbrain/linter#150?

Cipa commented Aug 21, 2014

Yes, I get the same errors

tried both
atom Dropbox/Sites/startup/

dmnd commented Aug 21, 2014

Cipa commented Aug 21, 2014

Thx, let me know if you need more details

patrickmaciel commented Nov 22, 2014

I get the same error. I’m giving up.

steelbrain commented Jul 7, 2015

Arcanemagus commented Jul 7, 2015

Are you sure this was fixed in #30?

I am now getting the following on v1.0.1:

However no further information is being shown in the console.

steelbrain commented Jul 7, 2015

Arcanemagus commented Jul 7, 2015

Источник

Visual Studio Code: Spawn UNKNOWN

There are multiple other posts reporting this, but they are related to javascript frameworks, etc.

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

Similar posts, but does not solve:

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

2 Answers 2

check your config file (F1 + config and select settings json) and search for:

I have the same error and it was because I have pointing to the wrong file:

it must point to (in my case):

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

Either you are using XAMPP or have installed PHP alone on Ubuntu Linux, you can always run whereis php in your terminal to locate php path.

I hope this helps developers!

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

Not the answer you’re looking for? Browse other questions tagged php visual-studio-code or ask your own question.

Linked

Related

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.9.17.40238

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Error when spawning a custom PHP executable: ENOENT #8

Comments

richardbushell commented Aug 4, 2018

I’m trying to use gulp-php-minify version 7.1.1, but I get a an error:
spawn C ENOENT

gulp.task(‘minifyphp’, function (cb) <
pump([
gulp.src(SRC + ‘*.php’, ),
phpMinify( <
binary: ‘path_to\php\php5.6.35\php.exe’
>),
gulp.dest(DEST + ‘php_min’)
],
cb
);
>);

Error: [@cedx/gulp-php-minify] spawn C ENOENT
at Minifier._transform (C:\Users\rb\Desktop\web_webdev\node_modules@cedx\gulp-php-minify\lib\minifier.js:83:30)
at
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)

Any ideas as to the potential reason for this Error?

Can I also just confirm whether it handles files with combined PHP and HTML content, i.e. that it just minifies within the PHP tags, and just passes through the rest of the HTML untouched.

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

richardbushell commented Aug 4, 2018

p.s. I also tried it with the php7.2.4 on the path instead

richardbushell commented Aug 4, 2018

Might requiring cross-spawn instead of child_process by default solve this issue on Windows? (I have seen many people post in other packages about similar issues, but I can’t see any similar issues or solutions posted here)

cedx commented Aug 22, 2018 •

Thanks for reporting this issue. I finally tested on a Windows machine, and I’ve reproduced this bug.
I need to look further ahead: it’s a regression. Previously, this plugin worked very well on Windows.
I will try to release a fix in the next days.
EDIT : the bug is also on Linux, so currently the plugin is unusable (and using cross-spawn should not be sufficient).

richardbushell commented Oct 5, 2018

@cedx Did you manage to find a fix?

richardbushell commented Nov 5, 2018

@cedx I have now updated to node10 and gulp4, but I still get the same error using gulp-php-minify version 9.0.0. Did you manage to find a solution for this that hasn’t yet been published in the latest build?

cedx commented Jan 29, 2019

It should be fixed in version 9.1.0.

richardbushell commented Jan 29, 2019

Sorry, I get the same issue with 9.1.0:-
Error: [@cedx/gulp-php-minify] spawn C ENOENT
at Minifier._transform (C:\Users\rb\Desktop\web_webdev\node_modules@cedx\gulp-php-minify\lib\minifier.js:56:26)
at process._tickCallback (internal/process/next_tick.js:68:7)

cedx commented Jan 29, 2019

richardbushell commented Jan 30, 2019

gulp minifyphp
[16:46:47] Using gulpfile

\Desktop\web_webdev\wdtv\gulpfile.js
[16:46:47] Starting ‘minifyphp’.
Minifying: C:\Users\rb\Desktop\web_webdev\wdtv\src\php_min\getVenueSuppliers.php
[16:46:47] ‘minifyphp’ errored after 43 ms
[16:46:47] Error: [@cedx/gulp-php-minify] spawn C ENOENT
at Minifier._transform (C:\Users\rb\Desktop\web_webdev\node_modules@cedx\gulp-php-minify\lib\minifier.js:56:26)
at process._tickCallback (internal/process/next_tick.js:68:7)

C:\Users\rb\Desktop\web_webdev\wdtv>gulp minifyphp
C:\Users\rb\Desktop\web_webdev\node_modules@cedx\gulp-php-minify\lib\minifier.js:58
else
^^^^

SyntaxError: Unexpected token else
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)

cedx commented Jan 30, 2019

richardbushell commented Jan 30, 2019

Ah, sorry, of course there’s now two statements in the IF statement so needed a block adding!
Here’s the revised error log:-
gulp minifyphp
[19:18:29] Using gulpfile

\Desktop\web_webdev\wdtv\gulpfile.js
[19:18:29] Starting ‘minifyphp’.
Minifying: C:\Users\rb\Desktop\web_webdev\wdtv\src\php_min\getVenueSuppliers.php
Error: spawn C ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
[19:18:29] ‘minifyphp’ errored after 43 ms
[19:18:29] Error: [@cedx/gulp-php-minify] spawn C ENOENT
at Minifier._transform (C:\Users\rb\Desktop\web_webdev\node_modules@cedx\gulp-php-minify\lib\minifier.js:57:26)
at process._tickCallback (internal/process/next_tick.js:68:7)

cedx commented Feb 1, 2019

I was hoping that this trace would give me more info. No luck: that’s not the case.

Let’s try to investigate : ENOENT means that the PHP binary was not found at the specified path. So the first thing that we need is the real path that is searched by the plug-in.

richardbushell commented Feb 1, 2019 •

OK, that looks promising, this gives:-
PHP Path: C

but my Gulp Task contains:

So, is something going wrong there?

cedx commented Feb 1, 2019

Very interesting. You’ve found the hidden bug 👍 (I mean : thanks to this path, I know now where is probably the bug). The «:» character has a special usage in the code (cf. see minifier.js@L56). It should not be an issue when I look closely, but using another character does not change anything and should fix this problem.
I will try to release another version soon, but I go on vacation tomorrow for one week. So, you’ll probably have to wait a few days.

cedx commented Feb 1, 2019

OK, the bug is here : https://github.com/cedx/gulp-php-minify/blob/master/src/minifier.ts#L58
I’m doing too much PHP : I thought that split() in JS works the same as explode() in PHP, but the limit parameter has not the same usage.

richardbushell commented Feb 1, 2019

Yes, that looks like the problem. I am no expert and I haven’t looked through the wider code modules so I cannot understand why you concatenate the mode and binary on Line 41 only to split them again on Line 57? Why not store the values independently as this._mode and this._binary? Anyway, the colon : character would certainly have broken the executable path when split resulting in my path reporting as C. Hopefully, that fix will solve the issue with specified PHP executable paths (as in my case). Have a lovely vacation! (it can certainly wait until you get back. )

cedx commented Feb 1, 2019

I just released a new version 9.1.1 on npm. The new code is safe whatever character is used (removed the usage of the limit parameter on the split call). Hope that it will fix this issue.

richardbushell commented Feb 1, 2019

Works perfectly, thank you. Have a great vacation!

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Problem with npm start (error : spawn cmd ENOENT)

I have a problem with my application. Because before when I created an application it worked, but now, it shows me this error and I do not know why and the things I have to do to fix it.

I checked some stackoverflow topics but everywhere I checked, it was not really an answer that worked.

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

5 Answers 5

Add C:\Windows\System32 to the global PATH environment variable.

Solution 1

Solution 2

If the first one doesn’t work follow the 2nd steps. Navigate to your project folder and type this command >>>

Solution 3

Downgrade react-scripts in package.json file

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

I had the same problem after I tried to install Mongo DB. I found out that this problem only exists with react-scripts@3.0.0. Try to reinstall your npm with a different react script version. Simply go to your folder in command and reinstall like this:

After that the app worked for me again.

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

For all those Who’ve come to this problem from react scripts not starting. The solution is

php error spawn php enoent. Смотреть фото php error spawn php enoent. Смотреть картинку php error spawn php enoent. Картинка про php error spawn php enoent. Фото php error spawn php enoent

Not the answer you’re looking for? Browse other questions tagged node.js reactjs windows git-bash or ask your own question.

Linked

Related

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.9.17.40238

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *