Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:59:27+00:00 2026-05-25T21:59:27+00:00

First of all I am showing the PHP code …. <?php echo (hello); echo

  • 0

First of all I am showing the PHP code ….

<?php 

 echo ("hello");

 echo exec("sendip -v -p ipv6 -6s 2001::100 -p tcp -ts 21 -td 21 2001::200 2> 
 &1");

 echo ("hi");

 ?>

When I entered the command through linux command line it is working fine.The command is sending a tcp ipv6 packet on 2001::200 machine from 2001::100.

[root@udit-pc]# sendip -v  -p ipv6 -6s 2001::100 -p tcp -ts 21 
-td 21 2001::200 > /dev/null &

/* (-v for verbose) */    

Output of above command …

 Added 34 options
 Initializing module ipv6
 Initializing module tcp
 Finalizing module tcp
 Finalizing module ipv6
 Final packet data:
 60 00 00 00   `...
 /*

  here other packet 
  contents gets printed

  */

 7D 62 00 00   }b..
 61 62 63 64   abcd
 Sent 64 bytes to 2001::200
 Freeing module ipv6
 Freeing module tcp

When I execute the php script through command line…

[root@udit-pc]# php test.php
Freeing module tcp

hellohi gets printed and packet arrived at 2001::200.

But problem arise when I try to run php script through browser…

 http:://localhost/test.php

hellohi gets printed but packet does not arrive at other machine.

 sh: sendip: command not found

Also in both case packet contents are not printed at terminal although using verbose option but when directly using command verbose option works fine.

I tried with many things although I do not think they would help like……

  1. I added /usr/local/lib and usr/local/bin to PATH variable but no benefit.

  2. chmod +s /usr/local/bin/sendip .Sticky bit set but again no benefit.

  3. paste the /usr/local/bin/sendip itself in /var/www/html folder although I have changed the PATH variable but as i said i m just using hit n trial getting no clue…..

There are some output snapshots which may further help ….

[root@cc html]# echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: 
/usr/X11R6/bin:/root/bin:/usr/local/lib

[root@cc html]# locate sendip
.....
/usr/local/bin/sendip
/usr/local/lib/sendip
.....

 [root@cc bin]# chmod +s sendip
 [root@cc bin]# ls -l sendip
 -rwsrwsrwx 1 apache apache 41071 Sep 26 19:41 sendip

 [root@cc bin]# cd /usr/local/lib/
 [root@cc lib]# ls -ld sendip
 drwxrwxrwx 2 root root 4096 Sep 28 22:48 sendip
 [root@cc lib]# chmod +s sendip
 [root@cc lib]# ls -ld sendip
 drwsrwsrwx 2 root root 4096 Sep 28 22:48 sendip

When file contents are changed …….

 <?php
 echo exec("/usr/bin/sendip ........  2 > &1");
 ?>

Then oputput is :

 [root@cc html]# php test.php
 Freeing module tcp[root@cc html]# 

On browser….
No error gets printed but packet still not arrived.

I am stuck in between.Please suggest me what else should I rather try ??????/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:59:28+00:00Added an answer on May 25, 2026 at 9:59 pm

    is sendip() in the path of the shell being invoked by PHP? You’re not checking for error conditions, so possibly you’re not actually executing sendip, and just getting a “no such program or file” type errors.

    Instead of redirecting the exec()’d command’s output to null, redirect it all to the browser so you can see what happens:

    echo exec("sendiip yada yada yada 2>&1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, I'm not looking for miracle... I know how PHP works and
First of all, I'd like to point out that I'm not asking for code.
First of all this method clearly working on github, for example pages showing done:
First of all, I know how to build a Java application. But I have
First of all, I don't need a textual comparison so Beyond Compare doesn't do
First of all, I'm fairly sure snapping to grid is fairly easy, however I've
First of all: I am not an experienced ClearCase user, but I have lots
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
First of all there is a partial question regarding this, but it is not
First of all, let's define a few tables: Users table will store information about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.