Issue with connecting/excuting PHP through gulp-connect

159

I am trying to use/run Google Web-Starter-Kit with PHP code and surfing through internet I found gulp-connect-php which helps to run PHP files inside gulp server(we can connect gulp with our local php service). So that i installed gulp-connect-php and added the following code togulpfile.js code:

var  connect = require('gulp-connect-php');
gulp.task('connect', function() {
connect.server({
hostname: '0.0.0.0',
bin: 'C:/wamp/bin/php/php5.5.12/php.exe',
ini: 'C:/wamp/bin/php/php5.5.12/php.ini',
port: 8000,
base: 'dev'
});
});
gulp.task('default', ['connect']);

and entered the below command to execute gulp server with gulp-conntect

>gulp connect

but it throwing some ERROR with path i specified for PHP applicatoin.

ERROR:

E:\my-project>gulp connect
[10:51:57] Using gulpfile E:\my-project\gulpfile.js
[10:51:57] Starting 'connect'...
[10:51:57] Finished 'connect' after 12 ms
events.js:85
      throw er; // Unhandled 'error' event
        ^
Error: spawn C:/wamp/bin/php/php5.5.12/php.exe ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)

I don't know where the issue lies on. please help on this.

109

Answer

Solution:

An ENOENT error usually indicates that a file or directory is missing. Seeing that you are on windows, this would most likely be due to a wrong direction of slashes.

Try

 bin: 'C:\\wamp\\bin\\php\\php5.5.12\\php.exe'

(same for ini) and make sure this file really exists! Other than that, if you can callphp directly from your command line, you shouldn't need to point to the EXE file at all.

People are also looking for solutions to the problem: sql - Drop down, results table not showing Mysql php

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.