dongpa6867 2016-08-12 15:12
浏览 67
已采纳

gulp-connect-php无法正常工作

I cannot get gulp-connect-php to work. I tried about everything SO and the www has to offer. The message I get is as following.

PHP server not started. Retrying...

Here's the last code I've tried.

gulp.task('connect', function() {
   connect.server({
      hostname: 'localhost',
      bin: 'C:/php/php.exe',
      ini: 'C:/php/php.ini',
      port: 8000,
      base: ''
   });
});

Now I've tried using it with browser-sync and the express server. With those I can get .html-files working on localhost. But whenever I set a .php-file to load I read a 404 or if I put in the url directly I download the file.

I've tried on Windows 10 and on El Capitan (these particular lines of code adjusted of course for MacOS). I checked that PHP is installed and added to the PATH. Not to mention that I've tried various different setups in my gulpfile.js.

EDIT: I installed XAMPP. PHP works fine there. The very script I try loading with gulp works fine.

  • 写回答

1条回答 默认 最新

  • dounuo9921 2016-08-24 18:34
    关注

    What version of gulp-connect-php are you using? I have use this for many projects and it worked great until recently when I updated the module. I deleted the module and installed the last version that worked for me 0.0.5, and it's working as expected. You could try the same and see if it works- delete the folder and use:

    npm install gulp-connect-php@0.0.5
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器