Comments (11)
I'm getting a similar problem using grunt-php
with Travis:
Screenshot
It falls into an infinite loop of 500 errors and is never able to move to the next Grunt task. Works fine locally though. Also not sure if this is a grunt-php bug, or a Travis configuration issue. Edit: It was a Travis configuration issue.
from grunt-php.
Same issue here, not using Travis.
OS X 10.9.1, latest grunt and grunt-php.
from grunt-php.
Sadly I got exactly the same problem. Was running for month w/o any problem, but not this time. Funny thing is, that it still does run and display the local site propery. For whatever reason.
from grunt-php.
Me too, I have no problem since the first time I use it, but not today (I still can use it yesterday)
and this is my Gruntfile.js
:
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
php: {
server: {
options: {
port: 8088,
open: true
}
}
},
// Other grunt task here
watch: {
options: {
nospawn: true,
livereload: true
},
backend: {
files: '<%= phplint.backend %>',
tasks: 'phptest'
},
// Some other Less & JS watcher here
}
});
grunt.registerTask('default', ['php:server', 'watch']);
}
from grunt-php.
@feryardiant Looks like your PHP script does a 302 redirect immediately upon hitting /
, which could be messing up this plugin. Maybe try configuring it to return a 200 instead?
from grunt-php.
Yes! you're right @nfrasser.
but, I still wondering why it could be messed up with redirection at the first run but not when it has been running?
I hope you know what I meant.
from grunt-php.
https://github.com/sindresorhus/grunt-php/blob/v0.4.0/tasks/php.js#L17-L21
Upon connecting this plugin calls the checkServer
function, which recursively calls itself until the server returns a status other than one of 200, 404, or 301.
Potential fix could be checking that the status code is in the 200-499 range instead?
from grunt-php.
which recursively calls itself until the server returns a status other than 200, 404, or 301.
Not "other than". It stops checking after it get either 200, 404, or 301. This it to make sure the server is started before it continues as the following task might depend on it.
from grunt-php.
Whoops yeah that's what I meant
from grunt-php.
As an update to what @sindresorhus had said, a recently merged PR (d8508d6) will now accept any 200, 300, or 400-level response, not just the three previously mentioned. Because 500-level errors indicate an error state they are not accepted as a valid state in which the script can continue to execute.
@sindresorhus It might be wise to throw an error in grunt if the callback check fails too many times. What do you think?
from grunt-php.
It might be wise to throw an error in grunt if the callback check fails too many times. What do you think?
Sure
from grunt-php.
Related Issues (20)
- Add middleware options HOT 6
- watch livereload task works slow HOT 1
- Suppress loaded resources in shell? HOT 4
- KeepAlive: false HOT 1
- Problem running grunt-php in windows. HOT 1
- Here's how to setup this plugin with livereload HOT 1
- How can I specify which browser should be used with the 'open' parameter? HOT 7
- Couldn't find the PHP binary HOT 1
- hi can i use it with yeoman webapp generator?!! HOT 1
- Ability to add environment variables HOT 2
- Problem with router.php only when being ran from task HOT 6
- Directory not found HOT 9
- how can I set a variables in *.php HOT 3
- Build failing HOT 1
- mysqli class not found HOT 1
- how to: server config, .htaccess, 404 page file, etc. HOT 2
- Fatal error: Cannot set property 'build' of null HOT 1
- Checking if the grunt-php server is running HOT 1
- Is there a way to use HTTPS out of the box? HOT 1
- Rewrite rules HOT 1
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 grunt-php.