php-general Digest 13 Sep 2012 07:46:03 -0000 Issue 7961
php-general Digest 13 Sep 2012 07:46:03 - Issue 7961 Topics (messages 319043 through 319052): Re: How to limit source IP in PHP 319043 by: Tommy Pham 319044 by: Tonix (Antonio Nati) 319046 by: Daniel Brown 319047 by: Tonix (Antonio Nati) 319048 by: Tommy Pham 319049 by: Daniel Brown 319051 by: Tonix (Antonio Nati) PHP array unions 319045 by: Adam Richardson 319050 by: Sebastian Krebs Programmers and developers needed 319052 by: agbo onyador Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- 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 which IP to bind. Instead I'd love some domains are permitted to open connections only from the domain IP. In FreeBSD I do it easily, setting up dedicated jails for domains. But how to do it simply using PHP on Linux? Regards, Tonino Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it 1) Use Listen in Apache 2) Use VM such as KVM, VMWare, etc. 3) Make an array containing permissible domains. Check the $_SERVER['SERVER_NAME'] if exists in that array. React/respond accordingly. ---End Message--- ---BeginMessage--- 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 looks like any PHP script can freely choose which IP to bind. Instead I'd love some domains are permitted to open connections only from the domain IP. In FreeBSD I do it easily, setting up dedicated jails for domains. But how to do it simply using PHP on Linux? Regards, Tonino Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it 1) Use Listen in Apache 2) Use VM such as KVM, VMWare, etc. 3) Make an array containing permissible domains. Check the $_SERVER['SERVER_NAME'] if exists in that array. React/respond accordingly. 1) is only for listening. 2) means a VPS for each domain, which we already do with vmware and FreeBSD jails, but it is too expensive for some customers. 3) means I'm writing the script, which is not the standard situation. You must suppose the script to be written from a malicious user in a shared environment. 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. Regards, Tonino -- Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it ---End Message--- ---BeginMessage--- 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, and APIs. You'd have to configure the system to bind requests, as PHP does not presently have that capability (and, to my knowledge, there's no plan to change that). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ ---End Message--- ---BeginMessage--- 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 interface to underlying software, OS commands, and APIs. You'd have to configure the system to bind requests, as PHP does not presently have that capability (and, to my knowledge, there's no plan to change that). 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. Regards, Tonino --
php-general Digest 13 Sep 2012 19:51:24 -0000 Issue 7962
php-general Digest 13 Sep 2012 19:51:24 - Issue 7962 Topics (messages 319053 through 319066): Re: Programmers and developers needed 319053 by: Per Jessen 319054 by: Tim Dunphy 319055 by: Steven Staples 319056 by: Matijn Woudt 319057 by: Bastien Koert 319058 by: Marc Guay 319059 by: Robert Cummings 319063 by: Matijn Woudt Re: How to limit source IP in PHP 319060 by: Mihamina Rakotomandimby 319061 by: Mihamina Rakotomandimby 319062 by: Tonix (Antonio Nati) 319064 by: Tonix (Antonio Nati) 319065 by: Jim Lucas 319066 by: Tonix (Antonio Nati) Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- agbo onyador wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. Who is we ? -- Per Jessen, Zürich (12.2°C) ---End Message--- ---BeginMessage--- We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? On Thu, Sep 13, 2012 at 3:45 AM, agbo onyador onya...@gmail.com wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B ---End Message--- ---BeginMessage--- From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? ---End Message--- ---BeginMessage--- On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) ---End Message--- ---BeginMessage--- On Thu, Sep 13, 2012 at 8:44 AM, Matijn Woudt tijn...@gmail.com wrote: On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php meh, World Wide Web has been done... -- Bastien Cat, the other other white meat ---End Message--- ---BeginMessage--- I'll do it, but only if it's on paid on delivery and/or subsidized by African royalty. Are our comments still welcome? ---End Message--- ---BeginMessage--- On 12-09-13 08:44 AM, Matijn Woudt wrote: On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) There's a big one at the center of our galaxy :D Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. ---End Message--- ---BeginMessage--- On Thu, Sep 13, 2012 at 4:38 PM, Robert Cummings rob...@interjinn.com wrote: On 12-09-13 08:44 AM, Matijn Woudt wrote: On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) There's a big one at the center of our galaxy :D Cheers, Rob. Ah Rob, You're right!;) Maybe he realizes he needs a galaxy wide system now?? ---End Message--- ---BeginMessage--- 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 https://bugs.php.net/ to see if it can be included in a future release. PHP handler is triggered depending on the request (ie: GET /dir/file.php) The HTTP transaction stil has to be initiated fisrt then. The TCP connection has been opened before the HTTP gets to Apache.
[PHP] Programmers and developers needed
Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome.
Re: [PHP] Programmers and developers needed
agbo onyador wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. Who is we ? -- Per Jessen, Zürich (12.2°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? On Thu, Sep 13, 2012 at 3:45 AM, agbo onyador onya...@gmail.com wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
RE: [PHP] Programmers and developers needed
From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
On Thu, Sep 13, 2012 at 8:44 AM, Matijn Woudt tijn...@gmail.com wrote: On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php meh, World Wide Web has been done... -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
I'll do it, but only if it's on paid on delivery and/or subsidized by African royalty. Are our comments still welcome? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
On 12-09-13 08:44 AM, Matijn Woudt wrote: On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) There's a big one at the center of our galaxy :D Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 https://bugs.php.net/ to see if it can be included in a future release. PHP handler is triggered depending on the request (ie: GET /dir/file.php) The HTTP transaction stil has to be initiated fisrt then. The TCP connection has been opened before the HTTP gets to Apache. No chance PHP could change the binding IP. Filing the request is IMHO technically irrelevant. -- RMA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 REMOTE_HOST if possible (I did not look deep into APache documentation) -- RMA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 mean you can't put in a feature request at https://bugs.php.net/ to see if it can be included in a future release. PHP handler is triggered depending on the request (ie: GET /dir/file.php) The HTTP transaction stil has to be initiated fisrt then. The TCP connection has been opened before the HTTP gets to Apache. No chance PHP could change the binding IP. Filing the request is IMHO technically irrelevant. You are speaking about incoming connections, I suppose. I'm speaking about connections started from within PHP. Regards, Tonino -- Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
On Thu, Sep 13, 2012 at 4:38 PM, Robert Cummings rob...@interjinn.com wrote: On 12-09-13 08:44 AM, Matijn Woudt wrote: On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote: From: Tim Dunphy [mailto:bluethu...@gmail.com] Sent: September 13, 2012 7:26 AM We are looking for programmers and developers to create a world wide system. Is it bigger than a bread box? Will it blend? Sure, if you find a big enough blender ;) There's a big one at the center of our galaxy :D Cheers, Rob. Ah Rob, You're right!;) Maybe he realizes he needs a galaxy wide system now?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 that way): make Apache handle PHP on conditionnal REMOTE_HOST if possible (I did not look deep into APache documentation) PHP is like any other programming language. After it is called by apache, he can read and write files, as well as opening incoming and outgoing connections. Please check carefully http://www.php.net/manual/en/book.sockets.php. Regards, Tonino -- Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 talking about YOU running a PHP script as a daemon, then yes, you have the ability to BIND to an IP address. I do this in a few scripts/daemons of mine. I use the stream_* functions for this. But, if you are talking about calling fopen() from the CLI and have it bind to a specific IP when connecting out, that is more of a OS specific option. You will need to find out how to run a php script and have it bind to a given IP (or interface) when it connects to the WWW. Hope this helps. Jim Regards, Tonino -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 between the call received from Apache (which is not passed to PHP), and any connection PHP may open later. Unless you are talking about PHP being ran from cron or the CLI. if you are talking about YOU running a PHP script as a daemon, then yes, you have the ability to BIND to an IP address. I do this in a few scripts/daemons of mine. I use the stream_* functions for this. But, if you are talking about calling fopen() from the CLI and have it bind to a specific IP when connecting out, that is more of a OS specific option. You will need to find out how to run a php script and have it bind to a given IP (or interface) when it connects to the WWW. When apache starts a php script, the script can open a socket towards another end-point, asking to bind to any local address as source address. Period. Regards, Tonino Hope this helps. Jim Regards, Tonino -- Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
On Sep 13, 2012, at 3:45 AM, agbo onyador onya...@gmail.com wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. Wow! I'm looking for world wide money. tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programmers and developers needed
On Thu, 2012-09-13 at 16:48 -0400, Tedd Sperling wrote: On Sep 13, 2012, at 3:45 AM, agbo onyador onya...@gmail.com wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. Wow! I'm looking for world wide money. tedd _ t...@sperling.com http://sperling.com Join the queue... -- Thanks, Ash http://www.ashleysheridan.co.uk
[PHP] PHP 5.4.7 and PHP 5.3.17 released!
The PHP development team announces the immediate availability of PHP 5.4.7 and PHP 5.3.17. These releases fix over 20 bugs. All users of PHP are encouraged to upgrade to PHP 5.4.6, or at least 5.3.16. Key enhancements in these releases include: * Fixed bug #62955 (Only one directive is loaded from Per Directory Values Windows registry). * Fixed bug #62460 (php binaries installed as binary.dSYM). The full list of changes are recorded in the ChangeLog on http://www.php.net/ChangeLog-5.php For source downloads of PHP 5.4.7 and PHP 5.3.17 please visit our downloads page at http://www.php.net/downloads.php Windows binaries can be found on http://windows.php.net/download/ David Soria Parra, Stanislav Malyshev and Johannes Schlüter PHP Release Team -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 incoming connection. And so? There is no relation between the call received from Apache (which is not passed to PHP), and any connection PHP may open later. My experience has always been, with Apache and lighttpd at least, that the response comes from the IP:PORT that the request was made to. So, if I connect to http://10.10.10.10/ Then the response is going to come from PORT 80. You might want to run a little trafshow on your server to see how the traffic behaves. I have a number of web servers that I run, all with either apache or lighttpd, and they all behave this way. Here is the output of my http request from my office to my server: From Address To Address ProBytes CPS == 66.39.178.2..58479 66.39.167.51..80 tcp 725 12 66.39.167.51..80 66.39.178.2..58479 tcp 2720 66.39.178.2..52515 66.39.167.51..80 tcp 1303 66.39.178.2..54506 66.39.167.51..80 tcp 696 66.39.178.2..62658 66.39.167.51..80 tcp 700 66.39.178.2..65382 66.39.167.51..80 tcp 700 66.39.167.51..80 66.39.178.2..52515 tcp 545 66.39.178.2..50794 66.39.167.51..80 tcp 700 66.39.178.2..65015 66.39.167.51..80 tcp 711 66.39.167.51..80 66.39.178.2..54506 tcp 305 66.39.167.51..80 66.39.178.2..62658 tcp 305 66.39.167.51..80 66.39.178.2..65382 tcp 357 66.39.167.51..80 66.39.178.2..50794 tcp 357 66.39.167.51..80 66.39.178.2..65015 tcp 357 This is running Apache. Unless you are talking about PHP being ran from cron or the CLI. if you are talking about YOU running a PHP script as a daemon, then yes, you have the ability to BIND to an IP address. I do this in a few scripts/daemons of mine. I use the stream_* functions for this. But, if you are talking about calling fopen() from the CLI and have it bind to a specific IP when connecting out, that is more of a OS specific option. You will need to find out how to run a php script and have it bind to a given IP (or interface) when it connects to the WWW. When apache starts a php script, the script can open a socket towards another end-point, asking to bind to any local address as source address. But this is a secondary connection (that you open in process) and has nothing to do with the request connection to the server from the client. Period. Regards, Tonino -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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 within PHP. Which is a response to the incoming connection. And so? There is no relation between the call received from Apache (which is not passed to PHP), and any connection PHP may open later. My experience has always been, with Apache and lighttpd at least, that the response comes from the IP:PORT that the request was made to. 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 original HTTP request. It is well clear for anyone with a minimum knowledge of programming in apache that only apache listens and answers from the binded port of httpd. And, of course, any program/script/binary called from apache, will return his data to apache, and apache only will send them back to the original requester. At the same time it is well clear too that each called program/script/binary may live autonomously before returning data to apache, and do whatever action it requires to do, including the opening of a network socket to an external or internal server. And this is true for any language, from perl to C to PHP. Only first two replies understood the initial request, all other just added confusion to the thread. Regards, Tonino -- Inter@zioniInterazioni di Antonio Nati http://www.interazioni.it to...@interazioni.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Programmers and developers needed
On 9/13/2012 3:45 AM, agbo onyador wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. really?? A world wide system? And this is how you advertise it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Threading on Windows
It has been suggested: That because php does not support PCNTL threading on Windows that multiple services of php are an alternative. I am interested in this theory, if anyone is currently working on a project that (forks) processes off to another instance or service of PHP on windows please let me know. In some of my latest development I have some rather large processes that consume the single instance of PHP, threading these off would be ideal. Example: $tmpsrv=win32_query =win32_create_service(array( 'params' = __FILE__. install, 'service' = 'Name_of_the_service', 'display' = 'Name of service to be displayed in the service list' )); Any windows php developers have ideas, comments on this suggestion? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
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
Re: [PHP] Re: Programmers and developers needed
On 9/13/2012 7:39 PM, Jim Giner wrote: On 9/13/2012 3:45 AM, agbo onyador wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. really?? A world wide system? And this is how you advertise it? I thiknk he's still building it, not advertising it. Still, methinks i detect a bit of a whiff, but it could be my pits... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fwd: [PHP-DB] Prepared Statements - Search
Crud, forgot to include list. -- Forwarded message -- From: tamouse mailing lists tamouse.li...@gmail.com Date: Thu, Sep 13, 2012 at 10:31 PM Subject: Re: [PHP-DB] Prepared Statements - Search To: erosenb...@hygeiabiomedical.com On Thu, Sep 13, 2012 at 7:09 PM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear List - Here is another problem I am having with prepared statements. The last one was INSERT, this one is SELECT. Here is the database: mysql describe Intake3; ++-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | ++-+--+-+-+---+ | Site | varchar(6) | NO | PRI | | | | MedRec | int(6) | NO | PRI | NULL| | | Fname | varchar(15) | YES | | NULL| | | Lname | varchar(30) | YES | | NULL| | | Phone | varchar(30) | YES | | NULL| | | Height | int(4) | YES | | NULL| | | Sex| char(7) | YES | | NULL| | | Hx | text| YES | | NULL| | | Bday | date| YES | | NULL| | | Age| int(3) | YES | | NULL| | ++-+--+-+-+---+ 10 rows in set (0.00 sec) Here is my code: // Prepare statement $stmt = mysqli_stmt_init($cxn); $sql11 = SELECT 'Fname', 'Lname', 'Phone', Height, Hx, Bday, Age FROM Intake3 where 1 and (MedRec = ?) and (Site = ?) and (Sex = ?); // Allocates and initializes a statement object suitable for mysqli_stmt_prepare(). // Prepare statement, bind result variables, execute and place results into bound result variables mysqli_stmt_prepare($stmt, $sql11); mysqli_stmt_execute($stmt); mysqli_stmt_bind_result($stmt, $Site, $MedRec, $Fname, $Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age); //The error is in this statement. while (mysqli_stmt_fetch($stmt)) { printf(%s %s %s %s %s %s %s %s %s %s \n, $Site, $MedRec, $Fname, $Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age); } I get no output from the printf statement. I receive the following error: Warning: mysqli_stmt_bind_result(): Number of bind variables doesn't match number of fields in prepared statement. The query, with the values inserted, works on the command line Help and advice, please. Pay attention to the code you write. Your SQL SELECT Statement pulls in these fields, in this order: 'Fname' 'Lname' 'Phone' Height Hx Bday Age Got that? Your bind statement binds the following variables: $Site $MedRec $Fname $Lname $Phone $Height $Sex $Hx $Bday $Age So, pairing those up, this is the relationship the bind statement sees: Column - PHP variable -- 'Fname' - $Site 'Lname' - $MedRec 'Phone' - $Fname Height - $Lname Hx - $Phone Bday - $Height Age - $Sex and oops, out of columns to bind to the remaining items: ??? - $Hx ??? - $Bday ??? - $Age So, lesson is: the bind results statement must match exactly one-for-one with each column returned in the SELECT statement. Additionally, I'm really uncertain the effect of the surrounding single quotes on 'Fname', 'Lname' and 'Phone' in your SELECT statement; perhaps they don't matter, but I've never seen that. Column names such as you show do not need to be quoted, as none of them represent MySQL key/reserved words, and when you do quote field names in MySQL, you use the backtick, i.e. `, not a single quote. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Threading on Windows
On Thu, Sep 13, 2012 at 9:32 PM, admin ad...@buskirkgraphics.com wrote: It has been suggested: That because php does not support PCNTL threading on Windows that multiple services of php are an alternative. I am interested in this theory, if anyone is currently working on a project that (forks) processes off to another instance or service of PHP on windows please let me know. In some of my latest development I have some rather large processes that consume the single instance of PHP, threading these off would be ideal. Example: $tmpsrv=win32_query =win32_create_service(array( 'params' = __FILE__. install, 'service' = 'Name_of_the_service', 'display' = 'Name of service to be displayed in the service list' )); Any windows php developers have ideas, comments on this suggestion? I'm interested in the answer to this as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP array unions
On Wed, Sep 12, 2012 at 2:37 PM, Sebastian Krebs krebs@gmail.com wrote: Hi, In PHP the array is in fact a hash map, but especially it is _used_ for nearly everything map-, set-, ...-like thing. So in short: The is no operator or built-in function, that merges two arrays _and_ treat them as set (instead of the hashmap, what they are). Your solution is the way to go. Sure, I know about the underlying implementation. I was just hopeful because several of the array functions handle the maps differently depending on whether the keys are numeric or string or both. If I wanted to get cute, I could store the value in the key (e.g., array('value 1' = 0, 'value 2' = 0, ...)), and that allows me to use the '+' operator. In spite of the nice performance benefits of this approach (leveraging the hashes benefits), the code that utilizes the arrays becomes quite clunky. Thanks, Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php