Comments (9)
Worked for me on Windows, after putting the php executable on the PATH. It just gave me a hard time, as the error message when PHP is not installed was quite hard to understand. No issues on Gulp 4.0 though.
from gulp-connect-php.
@KITSDominicWhite so the official line would be "Gulp4 has not been released in a final form", but I hate it when people respond like that... so I'll do the best I can to assist.
Gulp 4 has a bunch of breaking differences from Gulp 3 one of which is that tasks are supposed to return a promise or implement the 'done parameter callback pattern'. Failure to do so will cause the task to timeout with that warning if it is being held open by anything it invoked internally.
An example of the 'done parameter callback pattern' would be:
var gulp = require('gulp'),
connect = require('gulp-connect-php');
gulp.task('connect-sync', function(done) {
connect.server({});
// never invoking done should hold this task in a 'running' state
// Gulp4 checks the param count on the supplied function and
// if >= 1 waits indefinitely until a done() call is invoked.
});
gulp.task('default', gulp.series('connect-sync'));
Now, if for some reason you need this to hold until you are ready for it to complete... the following should work (Linux/Mac):
var gulp = require('gulp'),
connect = require('gulp-connect-php');
gulp.task('connect-sync', function(done) {
console.log(`Invoking gulp-connect-php on PID: ${process.pid}.`);
connect.server({});
// https://nodejs.org/api/process.html#process_signal_events
// NOTE:
// SIGINT might also work, that is sent when you issue CTRL+C
// However there is a chance Gulp reacts to it or hides it internally.
process.once('SIGUSR2', function() {
console.log("Got SIGUSR2, invoking callback.");
connect.closeServer();
done();
});
});
gulp.task('default', gulp.series('connect-sync'));
Now if you issue a signal via the command line:
kill -SIGUSR2 PID
That should tell the task to terminate.
(All of this is speculative, but it is what i'd try).
from gulp-connect-php.
@KITSDominicWhite any luck?
from gulp-connect-php.
Sorry @grmartin I went on holiday for a few days. I have given the first one a try with a few variants of my own, and unfortunately I haven't been able to get it working.
I am going to dig a little deeper into it and see if I can get some more information / figure it out :)
from gulp-connect-php.
@KITSDominicWhite No worries! If i can assist or if you get it working, please let me know.
from gulp-connect-php.
+1 to this issue
from gulp-connect-php.
+1
from gulp-connect-php.
I have gulp-connect-php
+ browserSync
working perfectly fine
using Gulp 4.0.0 + PHP 7.3.2 on Windows 10.
PHP.exe for me is on %PATH%
.
Does this issue only occur on Linux / macOS?
from gulp-connect-php.
it stopped working after requiring database connection (db.php)
from gulp-connect-php.
Related Issues (20)
- Port 8088 is already taken and the system does not start. HOT 1
- Closing sessions HOT 10
- Is this project still maintained? HOT 1
- Crash calling a batch under Windows HOT 4
- Crash when running version 1.0.0 HOT 11
- Cache with gulp-connect-php HOT 8
- Integration with Google Web Starter Kit
- Directory ../ does not exist. HOT 2
- Can't run server from custom bin directory HOT 4
- Is there a way to automatically add URL extensions? HOT 2
- Opening/Closing a Gulp PHP session in an Electron build HOT 1
- Suggest: options-open an URL
- Allow more than one string for the base path HOT 1
- TypeError: connect.server is not a function HOT 11
- when opening php file chrome downloads it HOT 1
- Add functionality to pass command line args to PHP HOT 3
- Odd issue with server occasionally stopping completely HOT 3
- Limiting logs to errors only HOT 1
- Electron | Blank window after build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-connect-php.