Answer the question
In order to leave comments, you need to log in
Why is gulp-connect-php not working?
Good evening dear ones.
This evening I was overtaken by the need to attach a php server to gulp, but something goes wrong ... I could deploy denwer in the old fashioned way and specify it as a proxy for BrowserSync, but I don't want to do that.
Neither in tandem with BrowserSync, nor on its own, gulp-connect-php works - endless loading at the coveted URL . Does it work for anyone? :) Out of the box, or should I dance?
I will not give my galpfile, due to its hugeness. Tried the examples from the documentation - to no avail.
Simplified example:
var gulp = require('gulp'),
connect = require('gulp-connect-php'),
browserSync = require('browser-sync');
gulp.task('connect-sync', function () {
connect.server({}, function () {
browserSync({
proxy: 'localhost',
port: 8000
});
});
gulp.watch('**/*.php').on('change', function () {
browserSync.reload();
});
});
gulp.task('default', ['connect-sync']);
Answer the question
In order to leave comments, you need to log in
Do you have php available from the terminal? The connection just runs the built-in php (since version 5.4) server on localhost:8000. Regular console command. If not, specify the path to the php binary in the connection parameters (as well as to php.ini).
Php still needs to be installed on the machine, why not deploy the same OpenServer / Xammp / Denwer and use the browser-sync? Hemorrhoids, in my opinion, less.
I am very confused by the lack of build in php.ini promised in the documentation in this package,Where is it promised? Never saw :)
In theory, everything should work.
Try it like this
or like this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question