
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
@ativsoftware/exec-php
Advanced tools
Execute PHP function within NodeJS application
npm install exec-php
let execPhp = require('exec-php');
execPhp('path/to/file.php', '/usr/bin/php', (err, php, out) => {
// the `php` argument is now contains all php defined functions
php.my_func(arg1, arg2, (err, res, out, print) => {
// `res` argument is now hold the returned value of `my_func` php function
// `print` hold anything that get printed during calling the `my_func` function
})
})
phpfile::string Path to user php file.phpbin::string Path to engine php binary file.callback::function A function to call after populating the php functions.The callback function will be called with below arguments:
error::mixed The error message.php::object The php object that hold all php defined functions.printed::string All printed string while populating php functions.All user defined function on php engine will be appended to php argument of
the caller. The function will be lower case. You can now call the function
normally with additional last argument is the callback function to get response
of the php functions call with below arguments:
error::mixed Error messageresult::mixed Returned content of user php functionoutput::string Printed string on requiring the php file.printed::string Printed string on calling user php function.// file.php
<?php
echo "One";
function my_function($arg1, $arg2){
echo "Two";
return $arg1 + $arg2;
}
// app.js
let execPhp = require('exec-php');
execPhp('file.php', (err, php, out) => {
// outprint is now `One'.
php.my_function(1, 2, (err, result, output, printed) => {
// result is now `3'
// output is now `One'.
// printed is now `Two'.
})
})
All uppercase function name on PHP will be converted to lowercase on exec-php.
// file.php
<?php
function MyFunction($a, $b){
return $a + $b;
}
// app.js
let execPhp = require('exec-php')
execPhp('file.php', (err, php, out) => {
php.myfunction(1, 2, function(error, result){
// result is now 3
})
})
noop function to support the new node callback standardmodule.parent ( Jakub Zasański )FAQs
Execute PHP function within NodeJS application
The npm package @ativsoftware/exec-php receives a total of 7 weekly downloads. As such, @ativsoftware/exec-php popularity was classified as not popular.
We found that @ativsoftware/exec-php demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.