P
P
Pashenka2015-09-17 22:30:04
PHP
Pashenka, 2015-09-17 22:30:04

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']);

To be clear, by default gulp-connect-php creates a server (maybe it doesn't? maybe I don't understand something?) capable of interpreting php (or not?) on the 8000th port of the localhost and the root for it is the location of the gulpfile.
P.S. I am very confused by the absence of the build in php.ini promised in the documentation in this package, just like any PHP binary.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey delphinpro, 2015-09-17
@like-a-boss

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 :)

I
Igor Nistakov, 2016-04-24
@belloni

In theory, everything should work.
Try it like this
or like this

M
M0OL0L, 2021-06-01
@M0OL0L

You can also use a local apache server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question