
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
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.
$ npm install --save-dev grunt-php
require('load-grunt-tasks')(grunt);
grunt.initConfig({
php: {
dist: {
options: {
port: 5000
}
}
}
});
grunt.registerTask('default', ['php']);
grunt.initConfig({
php: {
test: {
options: {
keepAlive: true,
open: true
}
}
}
});
grunt.registerTask('test', ['php', 'mocha']);
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']);
const path = require('path');
grunt.initConfig({
php: {
dist: {
options: {
directives: {
'error_log': path.resolve('logs/error.log')
}
}
}
}
});
grunt.registerTask('default', ['php']);
Supports all the php-server options in addition to the ones below.
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.
Type: boolean
Default: false
Suppress output produced by the PHP server.
MIT © Sindre Sorhus
FAQs
Start a PHP server
We found that grunt-php demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.