Search code examples
phpgulpbrowser-sync

You can use a local server together with browser sync (gulp)


I have time using gulp, but I would like to know if using a local PHP server I can update the page immediately, or in its absence any other tool that allows me to update every change to PHP files


Solution

  • Add a php task to your gulpfile.

    var src = {
       php:'./public_html/**/*.php',
    };
    
    
    gulp.task('php', function(){
        gulp.src(src.php)
        .pipe(reload({stream:true}));
    });
    
    
    gulp.task ('watch', function(){
    // other watch tasks    
      gulp.watch(src.php, ['php']);
    
    });