Re: [PHP] How to limit source IP in PHP

2012-09-14 Thread Jim Lucas
On 09/12/2012 08:21 AM, Daniel Brown wrote: On Wed, Sep 12, 2012 at 10:18 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is PHP able to 'force' binding IP? I hoped there was an external directive I did not see, but probably this is a PHP lack. Not at all. Essentially, PHP is an

Re: [PHP] How to limit source IP in PHP

2012-09-14 Thread Jim Lucas
On 09/13/2012 04:15 PM, Tonix (Antonio Nati) wrote: Jim, sorry but you did not read carefully my posts. Since the fist post, I ALWAYS spoke about connections a PHP script may open autonomously (what you name second connection). I'm never speaking about listening/intercepting/using the

Re: [PHP] How to limit source IP in PHP

2012-09-14 Thread Tonix (Antonio Nati)
Il 14/09/2012 21:19, Jim Lucas ha scritto: On 09/13/2012 04:15 PM, Tonix (Antonio Nati) wrote: Jim, sorry but you did not read carefully my posts. Since the fist post, I ALWAYS spoke about connections a PHP script may open autonomously (what you name second connection). I'm never speaking

Re: [PHP] How to limit source IP in PHP

2012-09-14 Thread Stuart Dallas
Sorry for the top post but I don't have my laptop with me and, well frankly I'm too tired to be arsed! I think the confusion is coming from the word bind. I don't think man people at aware of he difference between binding a socket and having it listen on the port to which it's bound. People...

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Mihamina Rakotomandimby
On 09/12/2012 07:02 PM, Daniel Brown wrote: So, the answer is no, PHP is not able to do that. There is an (heavy) BASEDIR directive for disk, but nothing equivalent (and simpler) for IP. That's correct. However, that doesn't mean you can't put in a feature request at

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Mihamina Rakotomandimby
On 09/12/2012 04:53 PM, Tonix (Antonio Nati) wrote: PHP script can freely choose which IP to bind. PHP doesnt bind at all. The HTTP server (Apache, Lighthttpd,...) does. PHP is called only when the HTTP server wants (you configure it that way): make Apache handle PHP on conditionnal

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Tonix (Antonio Nati)
Il 13/09/2012 18:16, Mihamina Rakotomandimby ha scritto: On 09/12/2012 07:02 PM, Daniel Brown wrote: So, the answer is no, PHP is not able to do that. There is an (heavy) BASEDIR directive for disk, but nothing equivalent (and simpler) for IP. That's correct. However, that doesn't

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Tonix (Antonio Nati)
Il 13/09/2012 18:19, Mihamina Rakotomandimby ha scritto: On 09/12/2012 04:53 PM, Tonix (Antonio Nati) wrote: PHP script can freely choose which IP to bind. PHP doesnt bind at all. The HTTP server (Apache, Lighthttpd,...) does. PHP is called only when the HTTP server wants (you configure it

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Jim Lucas
On 09/13/2012 12:28 PM, Tonix (Antonio Nati) wrote: You are speaking about incoming connections, I suppose. I'm speaking about connections started from within PHP. Which is a response to the incoming connection. Unless you are talking about PHP being ran from cron or the CLI. if you are

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Tonix (Antonio Nati)
Il 13/09/2012 21:41, Jim Lucas ha scritto: On 09/13/2012 12:28 PM, Tonix (Antonio Nati) wrote: You are speaking about incoming connections, I suppose. I'm speaking about connections started from within PHP. Which is a response to the incoming connection. And so? There is no relation

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Jim Lucas
On 09/13/2012 12:55 PM, Tonix (Antonio Nati) wrote: Il 13/09/2012 21:41, Jim Lucas ha scritto: On 09/13/2012 12:28 PM, Tonix (Antonio Nati) wrote: You are speaking about incoming connections, I suppose. I'm speaking about connections started from within PHP. Which is a response to the

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread Tonix (Antonio Nati)
Il 14/09/2012 00:09, Jim Lucas ha scritto: On 09/13/2012 12:55 PM, Tonix (Antonio Nati) wrote: Il 13/09/2012 21:41, Jim Lucas ha scritto: On 09/13/2012 12:28 PM, Tonix (Antonio Nati) wrote: You are speaking about incoming connections, I suppose. I'm speaking about connections started from

Re: [PHP] How to limit source IP in PHP

2012-09-13 Thread tamouse mailing lists
Are you looking to use sockets? That's the only thing I can think of when you speak of binding to an ip address/port... http://php.net/manual/en/book.sockets.php ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to limit source IP in PHP

2012-09-12 Thread Tonix (Antonio Nati)
Is there a way to force a PHP script to bind to a prefixed IP? Actually, while you can assign more IPs to Apache for listening, assigning domains to specific IPs, it looks like any PHP script can freely choose which IP to bind. Instead I'd love some domains are permitted to open connections

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Tommy Pham
On Wed, Sep 12, 2012 at 6:53 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is there a way to force a PHP script to bind to a prefixed IP? Actually, while you can assign more IPs to Apache for listening, assigning domains to specific IPs, it looks like any PHP script can freely choose

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Tonix (Antonio Nati)
Il 12/09/2012 16:08, Tommy Pham ha scritto: On Wed, Sep 12, 2012 at 6:53 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is there a way to force a PHP script to bind to a prefixed IP? Actually, while you can assign more IPs to Apache for listening, assigning domains to specific IPs, it

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Daniel Brown
On Wed, Sep 12, 2012 at 10:18 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is PHP able to 'force' binding IP? I hoped there was an external directive I did not see, but probably this is a PHP lack. Not at all. Essentially, PHP is an interface to underlying software, OS commands,

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Tonix (Antonio Nati)
Il 12/09/2012 17:21, Daniel Brown ha scritto: On Wed, Sep 12, 2012 at 10:18 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is PHP able to 'force' binding IP? I hoped there was an external directive I did not see, but probably this is a PHP lack. Not at all. Essentially, PHP is an

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Tommy Pham
On Wed, Sep 12, 2012 at 7:18 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Il 12/09/2012 16:08, Tommy Pham ha scritto: On Wed, Sep 12, 2012 at 6:53 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is there a way to force a PHP script to bind to a prefixed IP? Actually, while you

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Daniel Brown
On Wed, Sep 12, 2012 at 11:38 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: So, the answer is no, PHP is not able to do that. There is an (heavy) BASEDIR directive for disk, but nothing equivalent (and simpler) for IP. That's correct. However, that doesn't mean you can't put in a

Re: [PHP] How to limit source IP in PHP

2012-09-12 Thread Tonix (Antonio Nati)
Il 12/09/2012 17:52, Tommy Pham ha scritto: On Wed, Sep 12, 2012 at 7:18 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Il 12/09/2012 16:08, Tommy Pham ha scritto: On Wed, Sep 12, 2012 at 6:53 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is there a way to force a PHP script to