Joined July 2014
·

Anthony Greco

New York
·
·

Posted to Use PHP with your Yeoman dev server over 1 year ago

There's no definition of lrSnippet anywhere so I got the following warning:

Running "connect:livereload" (connect) task
Warning: lrSnippet is not defined Use --force to continue.

I added the following at the top of Gruntfile.js:

var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;

and installed grunt-contrib-livereload and saved to package.json with the following from the terminal:

npm install --save-dev grunt-contrib-livereload

Then I discovered I was missing other dependencies and added the following to Gruntfile:

var path = require('path');

var mountFolder = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};

At this point I see an Internal Server Error 500. After some fiddling I found that changing the following:

gateway(__dirname + '/app', {
'.php': 'php-cgi'
}),

to:

gateway('<%= config.app %>', {
'.php': 'php-cgi'
}),

finally got everything in order and grunt serve ran successfully without a 500 error, although my browser only says: Cannot Get / Here's a gist of my gruntfile: https://gist.github.com/anthonygreco/a92333ed5e3ffe4dd1a9 any idea what's missing here? Also this is the feedback from grunt:

Running "connect:livereload" (connect) task
Verifying property connect.livereload exists in config...OK
File: [no files]
Options: protocol="http", port=9000, hostname="localhost", base=".", directory=null, keepalive=false, debug=false, livereload=35729, open, useAvailablePort=false, middleware=undefined
Started connect web server on http://localhost:9000

Not sure why it says middleware undefined either. :\ Really wish I could easily spin up a PHP webapp that's not just php served from one "api" folder and instead the entire app. Any assistance here is greatly appreciated.

Achievements
1 Karma
0 Total ProTip Views