Jump to content


Ping > "Operation not permitted"


1 reply to this topic

#1 JustinMs66

    Young Padawan

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:EARTH
  • Interests:Programming:<br />PHP<br />Javascript<br />Visual Basic<br />HTML<br />XHTML

Posted 03 September 2007 - 03:04 PM

$cmd = 'ping -c 2 www.yahoo.com > response.txt 2>&1';
 $shellOutput = shell_exec($cmd);
i am trying to get a ping command to work with php and that returns:
ping: icmp open socket: Operation not permitted

i tried changing to owner to the user that php executes the script on, and root. it changes nothing.

can someone please help me?

also, i am running on CentOS SE, PHP 5.2.3, Apache 1.3.

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 04 September 2007 - 05:50 PM

I suspect you aren't allowed to use shell_exec(). I honestly don't know what error it would return in that instance, but check your phpinfo() for any disabled_functions in the php.ini directives.

Otherwise, see it works with just a plain ping command, without the -c flag and all the other stuff, make sure that ping works period.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users