php - socket_sendto(): unable to write to socket [1]: Operation not permitted -


i trying send udp packet dedicated ip server. called provider , able have udp ports 7812 , 50000 opened on firewall incoming , outgoing data.

here script:

<?php  $msg = "220055"; //$msg = pack("h*" , "220055");  $len = strlen($msg);  print($msg); print($len);  $error = socket_last_error(); echo socket_strerror($error);  $sock = socket_create(af_inet, sock_dgram, sol_udp);  socket_set_option($sock, sol_socket, so_broadcast, 1); socket_sendto($sock, $msg, $len, 0, '70.92.255.81', 7812);  socket_close($sock);  phpinfo();  ?> 

when run $error = socket_last_error(); echo socket_strerror($error);, success message, when check error log, see:

php warning: socket_sendto(): unable write socket [1]: operation not permitted in /my webserver/phpfile.php on line 20.

i have listener set on endpoint , able send packet through phone using app same port , ip address.

what error , how fix it?


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -