shell script and php

flenters

Well-Known Member
Joined
Oct 14, 2005
Messages
341
Reaction score
15
I have a small problem and i am not to sure what i am doing wrong, I have a
Small shell script that checks the connected peers in asterisk for e.g

#!/bin/sh
asterisk –rx “iax2 show peers”

Then the code I use in my php is very simple passthru command.

<?
passthru (“./peers.sh”)
?>

Or I have tried

<?
passthru (“/var/www/peers.sh”)
?>

This however also does not work…. Not to sure what I can try
I can run the script successfully from the CLI … any suggestions ?
 
Are you running this PHP script from a webserver? If yes check what user the webserver is running as and if they have a shell defined and sufficient permissions.
 
i have tried exec() and system() such a small issue bleh ....
 
Top
Sign up to the MyBroadband newsletter
X