0

I been using gulp for front-end development lately and I find it very helpful. I use XAMPP in windows for making PHP website some of which sometime include database operations.

Now, I have used gulp-livereload and gulp-connect for starting a server for front-end but then it won't process the PHP files.

All I want to do is, PHP livereload with database access. Like livereloading but via XAMPP's server(since it can process PHP).

Manas N
  • 23
  • 6

1 Answers1

0

yes, I have found a temporary solution for now.

See, it's just temporary but as long as you write PHP correct, you will get the work done. Let me tell you how I do it.

Though right off the start I want to tell you that this is not a proper way to approach this, you should use some MVC framework. Anyway,

  1. I have XAMPP installed under Windows 8.1 and XAMPP's htdocs is in my "C" Drive.

  2. I then create a folder inside "htdocs" in which I put all my frontend + backend code.Basically, gulpfile.js is at the root, then there is a components folder in which all front-end sources reside. There is another folder at root called "www" inside which I put my index.php.

  3. Then I load gulp-livereload instead of gulp-connect and I add the livereload.listen(); method and Tags in all the php files I want to reload.

Works very fine except when PHP throws an error, untill you correct that error, you have keep reloading the page manually.

Manas N
  • 23
  • 6