doudui9516 2016-07-07 17:55
浏览 100

Gulp-connect-php无法在一台PC上启动PHP服务器

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?

  • 写回答

1条回答 默认 最新

  • duanliao3826 2017-01-29 04:26
    关注

    You PHP server is already running in build directory.So give proxy value as proxy:127.0.0.1:8010. You can browse you site through localhost:8000.

    评论

报告相同问题?

悬赏问题

  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站