Answer the question
In order to leave comments, you need to log in
Gulp.js + Browsersync + PHP + Ubuntu - why doesn't it work?
Hi all!
Installed the LEMP stack (nginx server) on Ubuntu, set it up, and it works.
Then I decided to install Browsersync and run it through Gulp.js, tracking changes in PHP files.
Does not track changes in PHP files. How to fix it?
Here is the contents of the gulpfile.js file:
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var paths = {
php:['./**/*.php']
};
gulp.task('php', function(){
return gulp.src(paths.php)
.pipe(reload({stream:true}));
});
gulp.task('browserSync', function() {
browserSync({
proxy: 'project.org'
});
});
gulp.task('watch', function() {
gulp.watch(paths.php, ['php']);
});
gulp.task('default', ['watch', 'browserSync']);
Answer the question
In order to leave comments, you need to log in
The solution was to simply add after the body tag
<script>
//<![CDATA[
document.write("<script async src='/browser-sync/browser-sync-client.js?v=2.17.5'><\/script>".replace("HOST", location.hostname));
//]]>
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question