Giter Site home page Giter Site logo

grunt-php's Introduction

grunt-php

Start a PHP server

Useful for developing PHP projects or running tests on them.

Pretty much a drop-in replacement for grunt-contrib-connect, except for the middleware option.

Uses the PHP built-in server.

Install

$ npm install --save-dev grunt-php

Usage

require('load-grunt-tasks')(grunt);

grunt.initConfig({
	php: {
		dist: {
			options: {
				port: 5000
			}
		}
	}
});

grunt.registerTask('default', ['php']);

Examples

Start a persistent PHP server and open in browser

grunt.initConfig({
	php: {
		test: {
			options: {
				keepAlive: true,
				open: true
			}
		}
	}
});

grunt.registerTask('test', ['php', 'mocha']);

Use it with BrowserSync

grunt.initConfig({
	php: {
		dist: {
			options: {
				port: 9000,
				base: 'dist' // Project root
			}
		}
	},
	browserSync: {
		dist: {
			bsFiles: {
				src: [
					// Files you want to watch for changes
				]
			},
			options: {
				proxy: '<%= php.dist.options.hostname %>:<%= php.dist.options.port %>',
				watchTask: true,
				notify: true,
				open: true,
				logLevel: 'silent',
				ghostMode: {
					clicks: true,
					scroll: true,
					links: true,
					forms: true
				}
			}
		}
	},
	watch: {
		// Your watch tasks
	}
});

grunt.registerTask('serve', [
	'php:dist',         // Start PHP Server
	'browserSync:dist', // Using the PHP instance as a proxy
	'watch'             // Any other watch tasks you want to run
]);
grunt.initConfig({
	php: {
		watch: {}
	}
});

grunt.registerTask('phpwatch', ['php:watch', 'watch']);

Add path for a custom error log

const path = require('path');

grunt.initConfig({
	php: {
		dist: {
			options: {
				directives: {
					'error_log': path.resolve('logs/error.log')
				}
			}
		}
	}
});

grunt.registerTask('default', ['php']);

Options

Supports all the php-server options in addition to the ones below.

keepAlive

Type: boolean
Default: false

Keep the server alive indefinitely. Any task specified after this will not run.

This option can also be enabled ad-hoc by running the task like grunt php:targetname:keepAlive.

silent

Type: boolean
Default: false

Suppress output produced by the PHP server.

Related

License

MIT ยฉ Sindre Sorhus

grunt-php's People

Contributors

amercier avatar bezoerb avatar brodkin avatar gglnx avatar jhankim avatar kevva avatar microstudi avatar mm-git avatar passy avatar richienb avatar sindresorhus avatar xavierpriour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-php's Issues

Couldn't find the PHP binary

Hi guys,

I testing this nice grunt module, but when i start "grunt task", i've this message :

Warning: Couldn't find the `php` binary. Make sure it's installed and in your $PATH Use --force to continue.

All dependency are installed, maybe i need php on my PC ? Can you help me ?

Thank you :)

Directory not found

Hi the commits that fixed #70 created a bug for me.
When I put '../' in base. The php server wont start and sais Directory does not exit. '..' does not work either.

.htaccess

Is there any way to configure a .htaccess to work with this?

Here's how to setup this plugin with livereload

I've spent a great amount of time trying to figure it out how to setup this plugin with livereload so I want to share how I've done it so others don't have a hard time like I did.

/*global module*/
module.exports = function (grunt) {
    'use strict';

    // config plugins
    grunt.initConfig({

        php: {
            server: {
                options: {
                    hostname: 'localhost',
                    port: 9000,
                    open: true,
                    keepalive: false
                }
            }
        },

        watch: {
            reload: {
                files: ['{,*/}*'],
                options: {
                    // enables a live reload server
                    // you need to add <script src="//localhost:35729/livereload.js"></script>
                    // on index.php before the closing </body> tag
                    livereload: true
                }
            }
        }

    });

    // load plugins
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-php');

    // setup tasks
    grunt.registerTask('dev', ['php:server', 'watch:reload']);

};

Checking if the grunt-php server is running

I use grunt-php to serve up development copies of built files to a separate staging site. (The staging site is also PHP-based, but hosted on a separate remote server.) When I'm on the staging site, I'd like to be able to test the status of the grunt-php server. I've tried PHP's get_headers(), as well as a few curl-based solutions to no avail. Was wondering if anyone round these parts might have a hot tip? Thanks in advance!

Using multiple base dirs like in grunt-contrib-connect

If grunt-php could accept multiple directories as base, just like grunt-contrib-connect we can easily run a PHP development server using Compass. The files Compass generate during a development cycle aren't copied to the app directory because you like to work from source files. Changing this probably means we can use CoffeeScript more easily as well.

E.g.:

Change

php: {
    livereload: {
        base: '<%= yeoman.app %>'
    }
}

to

php: {
    livereload: {
        base: ['.tmp', '<%= yeoman.app %>']
    }
}

Ability to set external php.ini

In order to set project specific configuration options, using a custom php.ini file in your project would add the ability to set extra options. This is especially helpful for settings that cannot be set at runtime (ini_set()).

Adding -c path/to/php.ini argument to php.js would be worth exploring?

Prerelease versions of PHP are not compatible

This package relies on sindresorhus/bin-version-check which in-turn relies on npm/node-semver. Unfortunately NPM's semver package does not accept the -dev prerelease suffix used by the developers of PHP. As such the requirement fails validation in the presence of a prerelease build of PHP despite the fact that it meets the specified ``>=5.4` range.

Consider adding text to the README explaining that prerelease versions of PHP are incompatible or look into why the values are not accepted. This may be a bug of this project if the NPM semver component does not accept -dev intentionally. If this is not the case the issue is somewhere upstream.

Getting error :Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

Hello,

I am getting this error with my php project. I did a few google searches and I found that you have to uncomment this : ;extension=php_pdo_mysql.dll in php.ini

Does grunt-php looked for an installed version of php on my machine. I come from wamp so this is a bit confusing for me.

Thank you !

Edit : found it, needed to use bin option

Use system-assigned port

There is a lot of web apps on my computer that uses a lot of ports and I cannot just pick random port manually for php because it can be used by other web apps. Also I need to share my project with teammates that have a same situation but with other web apps and busy ports.

So I think that it will be a good to search first available free port and use it instead of picking it manually and have a chance to face busy port.

In grunt-contrib-connect we can use 0 or ? value for port to use system-assigned port [1] but in grunt-php I have an error with 0 or ?

Invalid address: 0.0.0.0:0

Build failing

What's up with this project? Is it still working? Is it abandoned?

Thanks in advanced...

Non-Blocking task for windows

I'm running this task on a project that runs the UI with grunt-contrib-connect in the 8080 port, and grunt-php in the 9090 port for an API.

In Mac and Linux, it just works fine, it runs the php:server task and the continue with the watch task.

But in windows, when it runs the php:server task it blocks the next task to be executed, and then the watch task never get executed.

I'm not really sure if this is an issue of PHP by itself or related this plugin. Both, Unix and Windows are running php 5.5

Can't make php-grunt run as non-persistent

I can't make my php-grunt tasks run short-lived , I mean in a non-persistent way.

I am using php-grunt in the context of a project that I want to manage with Yeoman, so my current Grunfile.js is a customization of the Gruntfile.js that Yeoman generators provide.

Despite having set explicitly the keepalive option to false, whenever I run grunt test, the execution of php:test prevents the next task ( mocha ) from being executed.

Everything else seems to be working fine, including the server and PHP5.4 which really gets executed, but keeps running until Ctrl+C is pressed.

I couldn't make it work neither with or without the livereload plugin.

I'd appreciate if you can provide any hint on what the possible causes of this problem can be.

Cant keep watch/php:watch running

After installing this package, grunt phpwatch give me this

โฏ grunt phpwatch
Running "php:watch" (php) task
PHP 5.4.17 Development Server started at Tue Dec 17 16:06:15 2013
Listening on http://127.0.0.1:8000
Document root is /Users/MoOx/Sync/Development/XXX
Press Ctrl-C to quit.
[Tue Dec 17 16:06:15 2013] 127.0.0.1:53560 [200]: /

Running "watch" task
Waiting...[Tue Dec 17 16:06:15 2013] 127.0.0.1:53561 [200]: /

Done, without errors.

Not sure what is the issue, just noticing that the server port is not the same in the watch task output...

Here is my watch

grunt.registerTask('phpwatch', ['php:watch', 'watch'])

Add middleware options

With grunt-contrib-connect it's possible to use the middleware option to inject e.g. files from outside the base path you can set in grunt-php. Currently that's not possible (see #31), but something like

php: {
            watch: {},
            test: {
                options: {
                    keepalive: true,
                    open: true,
                    base: '<%= config.app %>/',
                    middleware: function (connect) {
                        return [
                            connect.static('.tmp'),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            }
        }

would be awesome to use grunt-php and grunt-wiredep. :)

How to use grunt-php with laravel

Hi,
sorry to bother you.
Is there a way to run

php artisan serve

with grunt-php ?

This my gruntfile

'use strict';

var paths = {
    js: ['Gruntfile.js', 'public/**/*.js', '!public/bower_components/**'],
    html: ['public/**/views/**'],
    css: ['public/**/css/*.css', '!public/bower_components/**']
};

module.exports = function(grunt) {

    require('time-grunt')(grunt);

   // Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            all: {
                src: paths.js,
                options: {
                    jshintrc: true
                }
            }
        },
        php: {
            dist: {
                options: {
                    port: 8000,
                    keepalive: true,
                    open: true
                }
            },
            watch: {
                 options: {
                     livereload: true
                 },
                 page: {
                        files: ['*.php', '*.html','*.js','*.css'],
                        tasks: ['php']
                 } 
            }
        }
    });

    //Load NPM tasks
    require('load-grunt-tasks')(grunt);
    grunt.registerTask('default', ['jshint','php']);

};

Problem with router.php only when being ran from task

If I run the following command from a terminal in the same directory as my GruntFile.js I can load my wordpress site using the built-in server:

php -S 127.0.0.1:35729 -t ../../../.. router.php

However if I run with the following configuration using grunt-php it fails:

php: {
    dev: {
        options: {
            hostname: '127.0.0.1',
            port: 35729,
            base: '../../../..',
            router: 'router.php',
            keepalive: false,
            open: true,
        }
    },
},
grunt.registerTask('default', [
    'php:dev',
    'watch'
]);

The error I get is:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'router.php' (include_path='.;C:\xampp\php\PEAR') in Unknown on line 0

Is there anything I need to do differently to get this task to work? I'm trying to run a wordpress site and I'm running Windows.

Thanks

Not so much an issue as a question on if I need to use this.

I noticed that my grunt serve task worked and fired up my browser but that then going to a php file it downloaded it. I am thinking why this was and ended up here in your project looking for answers.
I am trying to proxy in an API onto my test dev machine so need the php script to solve a cross domain issue.

So I need to go through installing this if I want to get php working correct..at least as far as the quick test server that gets fired up from grunt serve.

Thanks for your advice / answer help etc

how to: server config, .htaccess, 404 page file, etc.

Noob question I'm sure, but on shared hosting services like BlueHost/GoDaddy/etc. the root directory has a bunch of files .htaccess, 404 and other error page files, etc. Wondering if I can use these and how? (Or maybe, alternately, if there's any way to use/access/edit a server config file?)

All I want to do is redirect 404 errors to a php template, which can't be that complex as I figure it!

Unable to use via load-grunt-tasks

I faced with the error when I was trying to use grunt-php via load-grunt-tasks.

Running "php:dist" (php) task
Warning: Cannot call method 'apply' of undefined Use --force to continue.

It seems to me, that lack of description in the task's method definition should be the reason of that behavior

No such file or directory

This is not really an issue, but more a request for a tiny enhancement.
When there's no php-file in the root of the project grunt-php keeps on giving the following error in the console: "127.0.0.1:45145 [404]: / - No such file or directory", several times a second.
Grunt-php however runs normally. I fixed this by putting an empty index.php in the root of my project.

HTTP response code 400 is not accepted as valid.

As stated in pull request #34 all 200-, 300- and 400-level HTTP response codes should be accepted as valid. This is not working for HTTP response codes which are treated as an error by http.request(). So if there isn't any index file, server sends a 400 response code and grunt-php retries 21 times (checkServerTries = 20 + one initial try).

I had a deeper look in the problem. It's seems that node js is treating the error response header of php built in webserver as non valid. If you have a look at err in .on('error', function(err){}) it's set to HPE_INVALID_CONSTANT.

Fatal error: Cannot set property 'build' of null

As of the latest PHP update (7.0.8), this error is thrown right on startup.
System: Ubuntu 16.04 LTS

Gruntfile.js:

"use strict";

module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks

    grunt.initConfig({
        php: {
        test: {
            options: {
                keepalive: true,
                open: false // We don't have to open the back-end in the browser...
            }
        }
        }
    });

    grunt.registerTask('serve', ['php']);
};

Package.json:

{
  "name": "api",
  "version": "1.0.0",
  "description": "API Backend",
  "main": "gruntfile.js",
  "author": "Arjan Vlek",
  "devDependencies": {
    "grunt": "^1.0.0",
    "grunt-php": "^1.5.1",
    "load-grunt-tasks": "^3.5.0"
  }
}

Php -v:

PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies

Fatal error: spawn ENOENT when running grunt php

I'm pretty new to Grunt, but I can't seem to get grunt-php to work (has worked fine with Yeoman). I followed examples on grunt-php's readme.md, but whenever I run 'grunt php' or 'grunt test' I get the following error: Fatal error: spawn ENOENT

Here's my gruntfile:

'use strict';

module.exports = function (grunt) {
    grunt.loadNpmTasks('grunt-php');
    grunt.loadNpmTasks('grunt-mocha');

    grunt.initConfig({
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        php : {
            dist: {
                options: {
                    port: 5000,
                    base: 'subfolder'
                }
            },
            test: {
                options: {
                    keepalive: true,
                    open: true
                }
            }
        }
    });

    grunt.registerTask('test', [
        'php',
        'mocha'
    ]);

    grunt.registerTask('default', [
        'php'
    ]);

};

I'm running this on Windows 7 if that matters.

Problem running grunt-php in windows.

Hi,

I am testing the module grunt-php in local using a Windows machine but I receive the following message:

"Running "php:dist" (php) task
Warning: Couldn't find the `php` binary. Make sure it's installed and in your $P
ATH Use --force to continue.

Aborted due to warnings."

What is the problem?

module.exports = function (grunt) {
    'use strict';

    grunt.initConfig({
        php: {
            dist: {
                options: {
                    hostname: '127.0.0.1',
                    port: 9000,
                    base: './FOLDER_WITH_PHP_FILES', // Project root
                    keepalive: false,
                    open: false
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-php');

    grunt.registerTask('serve', [
        'php:dist',         // Start PHP Server
    ]);

};

How can I specify which browser should be used with the 'open' parameter?

I want to open the browser of my choice rather than the default system browser when the server starts running. In grunt-contrib-connect I am able to do this:

connect: {

    dev: {

        options: {

            keepalive:  false,
            port:       '<%= project.port %>',
            hostname:   '<%= project.hostname %>',
            open:       {

                target: 'http://<%= project.virtualHost %>:<%= project.port %>/<%= project.url %>',
                appName: '<%= project.browser %>'

            }

        }

    }

},

Currently my default browser is Safari and the server keeps opening that browser - but I want to launch Google Chrome when server starts instead.

Open option doesn't seem to work.

Had a look at this question tonight and it doesn't seem like grunt-php calls the open() method when the option is set to true, at least on my machine and the asker's. I'm running Mavericks. Was just wondering if anyone else can replicate this?

https://github.com/sindresorhus/grunt-php/blob/master/tasks/php.js#L51-L59

A temporary fix could be as simple as the one I offered in the question.

checkServer('http://' + host, function () {
    if (!this.flags.keepalive && !options.keepalive) {
        cb();
    }
}.bind(this));
// open the browser straight away
if (options.open) {
    open('http://' + host);
}

Thanks.

Watch doesn't work with "localhost"

If I want to run "watch" task with "php", If hostname is localhost it doesn't work, it needs to be an IP like on the tests 0.0.0.0 or 127.0.0.1

Workaround

php: {
  watch: {
    options: {
      hostname: "127.0.0.1"
    }
  }
}

mysqli class not found

On my windows 7 machine i am getting the following error message:
Class 'mysqli' not found in....

(- it's working fine on my mac)

watch livereload task works slow

Im using right now a simple integration with watch task from grunt-contrib-watch and it works but is very slow when reload.

In details I have my grunt php configured like this:

php: {
            port: 8000,
            hostname: 'localhost',
            watch: {}
        },

and my watch task are configured like this:

watch: {
            sass: {
                files: ['**/*.scss'],
                tasks: ['compile-sass']
            },
            php: {
              files: ['**/*.php'],
            },
            js: {
                files: ['**/*.js'],
            },
            html: {
                files: ['**/*.html', '**/*.hbs'],
            },
            options: {
                nospawn: true,
                livereload: true,
                events: ['all'],
            }
        },

And finally on my index.php I included the livereload.js script tag.

Is this normal or I'm doing something wrong?

how can I set a variables in *.php

HI, I use grunt-php in my project to run a php server, but I don't know how to set a variables in *.php? I use to get a value in php , so how can i set it?

Livereload

I just started using this plugin, and it's looking really solid so far; good job!

Any thoughts on a livereload feature in the future?

php livereload?

can the *.php files refresh in the browser automatically just like the function 'livereload' run in 'grunt-contrib-connect' when you change some code?

continously logging HTTP 500 errors on console

Hello,
first of all thank you for this grunt plugin! I've a (noob?) question related to my minimal grunt config:

module.exports = function(grunt) {
    'use strict';
    grunt.initConfig({

        php: {
            default: {
                options: {
                    port: 9000,
                    base: 'app/',
                    open: true,
                    bin: '/opt/local/bin/php55'
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-php');

    grunt.registerTask('default', [
        'php'
    ]);
};

every time I call grunt from command line I get the following output, that seems to me like something is continuously looking for a "/" page on progressively increasing local ports, and the server returns a HTTP 500 error (no process is serving pages on that ports). But I do not get why this happens, the php server works perfectly in the meantime, and if I run php -S localhost:9000 directly from the command line I do not get these messages.

$ grunt
Running "php:default" (php) task
PHP 5.5.7 Development Server started at Sat Dec 28 11:37:30 2013
Listening on http://127.0.0.1:9000
Document root is /Users/stefano/sviluppo/siti/noon/app
Press Ctrl-C to quit.
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53757 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53758 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53759 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53760 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53761 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53762 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53763 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53764 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53765 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53766 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53767 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53768 [500]: /
[Sat Dec 28 11:37:30 2013] 127.0.0.1:53769 [500]: /
[Sat Dec 28 11:37:31 2013] 127.0.0.1:53770 [500]: /
[...]

I do not even know if this is strictly related to grunt-php but the log is annoying and somehow prevents me to read eventual messages from the console (they scroll up rapidly).

I'm on a mac, OS X 10.9.1 (but I've the same issue with 10.8.x).

thanks in advance for any suggestion on how to suppress these messages!

Suppress loaded resources in shell?

Is there a way to suppress messages generated in the shell for every resource that is loaded? This gets in the way of other messages happening while grunting. Like Sass processing messages, linting output, etc.

Running with watch SCSS

How would you run this along side compass/sass? Trying to view a php web server with the SCSS/CSS changes being watched as well, not too sure if I'm doing something stupid. Gruntfile.js below:

    module.exports = function(grunt) {
            grunt.initConfig({
                    pkg: grunt.file.readJSON('package.json'),
                    compass: {
                            options: {
                                    config: 'config.rb',
                            }
                    },
                    php: {
                            options: {
                                    port: 8000,
                                    keepalive: true,
                                    open: true,
                                    base: 'public_html/',
                                    hostname: 'localhost'
                            },
                            watch: {
                                    options: {
                                            livereload: 8000
                                    },
                                    scss: {
                                            files: '**/*.scss',
                                            tasks: ['compass'],
                                            options: {
                                                    livereload: false
                                            }
                                    },
                                    css: {
                                            files: '**/*.css',
                                            tasks: [],
                                            livereload: 8000
                                    }
                            }
                    }
            });
            grunt.loadNpmTasks('grunt-contrib-compass');
            grunt.loadNpmTasks('grunt-php');
            grunt.loadNpmTasks('grunt-contrib-watch');
            grunt.registerTask('phpwatch', ['php:watch', 'watch']);
    }

KeepAlive: false

I've just started running grunt-php. I had an issue setting up grunt-php with watch. It's probably worth extending the ReadMe example, specifically to say that when you are using "watch", you cannot use "keepalive: true" in the php task.

I'm also having horrible performance serving all files, compared to when I was using PHP through iis-express. Any thoughts on what to look for?

[200] Errors in Terminal

Hey,

When I run the script I get a stream of [200] errors in my terminal window. Here's the output I'm getting:

[Sat Apr 12 23:05:40 2014] 127.0.0.1:51206 [200]: /assets/js/main.js
[Sat Apr 12 23:05:40 2014] 127.0.0.1:51207 [200]: /assets/js/plugins.js
[Sat Apr 12 23:05:40 2014] 127.0.0.1:51208 [200]: /assets/json/listing.json
[Sat Apr 12 23:05:49 2014] 127.0.0.1:51210 [200]: /assets/php/save.php
[Sat Apr 12 23:05:50 2014] 127.0.0.1:51212 [200]: /

Here's my config:

php: {
    dev: {
        options: {
            hostname: '0.0.0.0',
            open: true
        }
    }
},

Any idea why this might be happening?

grunt php error !

Hi!
I'm using yeoman with angular and I want using php on my project.
I installed grunt-php and after that, when I run "grunt php" It says " No "php" targets found. "

Execute .html as PHP

Is there anyway to process .html files as php? We use .html extensions on our files but would normally use apache to run them as php.

Unable to replace for grunt-contrib-connect. Won't start.

Hey Sindre,
I'm just taking a look at this grunt-php plugin. I believe its exactly what I'm looking for, however, I can't seem to get it to work. Likely something to do with the fact that I'm a grunt newb.

I tried a number of Gruntfile configurations and I'm just trying to get it to work in the default yeoman "webapp" by switching it out for grunt-contrib-connect.

Gruntfile
Package Screenshot

Can you point me in the right direction? I'm all grunt, yeoman and getstarted read out and need a bit of a push.

Cheers,
Dan

OSX 10.7.5
Node v0.8.9
grunt-cli v0.1.7
grunt v0.4.1

Getting odd 500-level response error

This task has been working like a charm on my macbook pro running yosemite, however recently and with little if any change that I can recall on my project I am now getting:

PHP 5.5.14 Development Server started at Mon Nov 10 22:58:51 2014
Listening on http://127.0.0.1:8080
Document root is /Users/micahblu/Projects/micahblu.com
Press Ctrl-C to quit.
[Mon Nov 10 22:58:51 2014] 127.0.0.1:50623 [500]: /
Warning: Server docroot returned 500-level response. Please check your configuration for possible errors. Use --force to continue.

Thanks for any insight on this. Going to run the project up on my ubuntu machine to see if I get it there as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.