Jump to content

Recommended Posts

i have been working on this for like 3 hours now, trying EVERYTHING!

i need to be able to make system commands work.

 

ping -c 2 -iphere- >response.txt

is the code i need. and in ssh, i execute it, and it works! in the response.txt file, i get a correct response:

 

PING -iphere- (-iphere-) 56(84) bytes of data.
64 bytes from -iphere-: icmp_seq=0 ttl=53 time=21.7 ms
64 bytes from -iphere-: icmp_seq=1 ttl=53 time=21.4 ms
--- -iphere- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms

 

But when i use ANY KIND of php system command execution, it does not work. i have tried the system(), exec(), shell_exec(), passthru(), and popen(). none work. response.txt comes up blank.

 

i have also tried setting the permissions to a variety of things, 777,775,755,644... etc.

i have also tried setting the owner permisions to root as well as the username that php file executes on.

 

nothing works and its pissing me off.

what pisses me off the most is that a command such as "ls" will work perfectly. but why won't this?

Link to comment
https://forums.phpfreaks.com/topic/67700-system-ping-command/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.