Announcement

Collapse
No announcement yet.

Problem phpoc error operation not permitted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem phpoc error operation not permitted

    I got the error log
    "PHP error operation not permitted in file task on line 56"


    This is my code

    PHP Code:
    $host_name "xx.xx.xx.xx";
    $host_addr "xx.xx.xx.xx";

    $tcp0_pid pid_open("/mmap/tcp0");

    echo 
    "connect to $host_addr:80...";

    pid_connect($tcp0_pid$host_addr80);

    for(;
    {
    $state pid_ioctl($tcp0_pid"get state");            // ======>  i have an error  at this line (Line 56) 
    //echo $state;
    if($state == TCP_CLOSED)
    {
    echo 
    "state closed";
    }

    if(
    $state == TCP_CONNECTED)
    break;

    How can i solve that?
    PHP Code:
    [PHP][PHP
    [/PHP][/PHP]

  • #2
    Hello,

    It seems that there is a syntax error in your code.
    For example,
    for(; ==> should be: for( ;; )

    Make sure you declare the correct host IP address for the variable $host_addr;

    You can refer to this tutorial about making a simple HTTP request from PHPoC Black.
    https://github.com/phpoc/phpoc-psp/t..._task/http_get

    PHPoC Programming Guide about TCP:
    https://www.phpoc.com/support/manual...id=tcp_connect

    If the issue still happens, please get back to us with the full source code of this part.
    Thanks

    Comment

    Working...
    X