Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I have a project that is using node and php. I have been using gulp-connect-php npm package to serve up the php server.

Now I am trying to clone this project over to my laptop from my desktop. I have shrinkwrapped the dependencies and the project is tested to run fine on 2 desktops as soon as I run npm install and gulp after cloning. The problem is that the project doesn't seem to work on my laptop. When I try to run gulp on my laptop, it ran all its gulp tasks except it is not starting the PHP server like so:

PHP 7.0.0 Development Server started at ...
Listening on http://127.0.0.1:8010

What I have in my gulp task:

var browserSync = require('browser-sync');
var gulp        = require('gulp');
var php         = require('gulp-connect-php');

gulp.task('serve', function() {
    php.server({
        base: 'build',
        port: 8010,
        keepalive: true
    }, function() {
        browserSync({
            proxy: '127.0.0.1:8010/build',
            watchTask: true,
            port: 8000
        });
    });
});

What can else can I do to find out why is the PHP server not being started?

share|improve this question
    
What operating system is this running on? – Jake Jul 7 at 18:10
    
@Jake It is running on Windows 10 (on all PCs tested) – Jenning Ho Jul 7 at 18:26
1  
I have manage to solve it. Just in case anyone is facing the same problem, it is because php is not installed properly during the installation of xampp. Once I add php path to the environment variables, everything runs fine. Apparently gulp-connect-php runs the installed php to start up the php server. Refer to stackoverflow.com/questions/17727436/… on how to add path to environment variables. – Jenning Ho Jul 11 at 3:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.