0

I cannot get gulp-connect-php to work. I tried about everything SO and the www has to offer. The message I get is as following.

PHP server not started. Retrying...

Here's the last code I've tried.

gulp.task('connect', function() {
   connect.server({
      hostname: 'localhost',
      bin: 'C:/php/php.exe',
      ini: 'C:/php/php.ini',
      port: 8000,
      base: ''
   });
});

Now I've tried using it with browser-sync and the express server. With those I can get .html-files working on localhost. But whenever I set a .php-file to load I read a 404 or if I put in the url directly I download the file.

I've tried on Windows 10 and on El Capitan (these particular lines of code adjusted of course for MacOS). I checked that PHP is installed and added to the PATH. Not to mention that I've tried various different setups in my gulpfile.js.

EDIT: I installed XAMPP. PHP works fine there. The very script I try loading with gulp works fine.

Tobias Philipp
  • 93
  • 1
  • 13

1 Answers1

3

What version of gulp-connect-php are you using? I have use this for many projects and it worked great until recently when I updated the module. I deleted the module and installed the last version that worked for me 0.0.5, and it's working as expected. You could try the same and see if it works- delete the folder and use:

npm install gulp-connect-php@0.0.5
bl3d
  • 56
  • 4
  • Thanks for the hint. I finally figured it out myself. Since your approach worked for yourself and could be helping somebody in the future I'll accept this answer. In my case it was actually the PATH variable after all. I confused the systems' environment variables with the users'. I was sure I set the PATH variable but it was the wrong one... Silly mistake that cost me a whole day. There was no hint in the error message whatsoever. – Tobias Philipp Aug 25 '16 at 13:36