Page 1 of 1

how can I 'socket_bind' to port 80?

Posted: Sat May 30, 2009 11:27 am
by paganeli
Hello!

I want to bind to port 80 but in order to do this I must run my php script as root. My script runs in cli. If i execute 'sudo php myscript.php' it connects to port 80. What should I do in order not to use sudo?? This script is called from another script by using proc_open. Is there any way to make it run?

Thanks in advance.

Re: how can I 'socket_bind' to port 80?

Posted: Sat May 30, 2009 10:03 pm
by SidewinderX
All ports below 1024 require root permissions. You can either:

1) Add yourself to the sudoers file
2) Install authbind
3) Use port address translation