Re: [PHP] Why is some_function()[some_index] invalid syntax?
2008. 01. 10, csütörtök keltezéssel 21.25-kor Jim Lucas ezt írta: Nathan Nobbe wrote: On Jan 10, 2008 11:00 PM, Arlen Christian Mart Cuss [EMAIL PROTECTED] wrote: Hi there, Why is it that if I try to evaluate an index of an array returned by a function immediately, a syntax error is produced? (unexpected '[', expecting ',' or ';') thats hillarious, i literally brought this up at the office like 2 days ago. ill tell you why its really lame (imho), because php5 supports syntax like this: function someFunc() { return date_create(); } echo someFunc()-format('Y-m-d'); that is, it allows you to chain a method invocation to the invocation of a function if the function returns an object. -nathan So, make all your functions return objects, and have the object have a method called get or index or something like that that returns the index requested. :) Better yet, make everything an object: String, Numeric, Array, etc and call it Java ;) greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
Suppose we were using apache webserver. I think obfuscation won't work since with some work a user could read the password. How to encrypt/decrypt the password? On Jan 11, 2008 3:37 AM, Chris [EMAIL PROTECTED] wrote: Not too much really. The webserver needs to be able to read a config file. You could obfuscate the fields/entries or encrypt them somehow, but it needs to be a two-way encryption (ie you're going to need to undo the encryption to be able to use the password). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
Some php applications store database passwords into files which can be read by the user www-data. So, a malicious user which can write php scripts could read those passwords. What should I do to prevent users from viewing those passwords? You could encode your file(s) using something like the Zend Encoder. This turns them into byte code IIRC, so it's hard (not totally impossible I think) to get the clear text. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser cache setting
Hi, What's the default setting for caching in browsers? With IE is it Automatically as I think it is? And what about other browsers? Some equivalent? Thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser cache setting
Richard Heyes wrote: Hi, What's the default setting for caching in browsers? With IE is it Automatically as I think it is? And what about other browsers? Some equivalent? I'm pretty certain it's automatic in most. I think Firefox has a default 50Mb of cache-space. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser cache setting
I'm pretty certain it's automatic in most. I think Firefox has a default 50Mb of cache-space. Great, thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
Lucas Prado Melo wrote: Hello, Some php applications store database passwords into files which can be read by the user www-data. Why not keep them out of the web tree and inform the application regarding the same. I am sure almost all good applications would provide a simple way for doing it. So, a malicious user which can write php scripts could read those passwords. What should I do to prevent users from viewing those passwords? I am not sure I understand this. Do you mean the attacker would upload scripts and execute them to read th config files? If yes then that's a different problem altogether. regards Regards, Bipin Upadhyay. http://projectbee.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Determine which are user defined keys?
2008. 01. 11, péntek keltezéssel 08.12-kor Christoph Boget ezt írta: Given the following array: ?php $myArr = array( 'joe' = 'bob', 0 = 'briggs', 'whatever', 'whereever'); echo 'pre' . print_r( $myArr, TRUE ) . '/pre'; ? Array ( [joe] = bob [0] = briggs [1] = whatever [2] = whereever ) joe and 0 are keys that I created whereas the key 1 and 2 are keys assigned by PHP when the array was created. When iterating through an array, is there a way to determine which were generated by PHP? I can't rely on whether or not the key is an integer because it's quite possible that such a key was user generated. I've gone through the docs and based on what I've read, I don't think something like this is possible but I'm hoping that's not the case. I don't think you can do that. Why not apply some modification to the 'user created' keys, like prepend them with a _ sign or something. in that case you can know for sure if its a php generated key or not. greets Zoltán Németh Any pointers? thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Determine which are user defined keys?
Given the following array: ?php $myArr = array( 'joe' = 'bob', 0 = 'briggs', 'whatever', 'whereever'); echo 'pre' . print_r( $myArr, TRUE ) . '/pre'; ? Array ( [joe] = bob [0] = briggs [1] = whatever [2] = whereever ) joe and 0 are keys that I created whereas the key 1 and 2 are keys assigned by PHP when the array was created. When iterating through an array, is there a way to determine which were generated by PHP? I can't rely on whether or not the key is an integer because it's quite possible that such a key was user generated. I've gone through the docs and based on what I've read, I don't think something like this is possible but I'm hoping that's not the case. Any pointers? thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is some_function()[some_index] invalid syntax?
On Jan 11, 2008 3:45 AM, Zoltán Németh [EMAIL PROTECTED] wrote: and call it Java ;) or perhaps javascript :) function cool() { return [1, 2, 3]; } alert(cool()[0]); -nathan
RE: [PHP] /etc/php.init changes not honored
I do not see an entry stating Loaded Configuration File in the output this only available since php 5.2 (iirc) -- View this message in context: http://www.nabble.com/-etc-php.init-changes-not-honored-tp14746039p14759509.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_start problems with FireFox on Mac
On Jan 11, 2008 11:53 AM, Jason Pruim [EMAIL PROTECTED] wrote: With a problem like that, code and a web page are very helpful to track it down. I'm willing to take a look at what I can with my Mac firefox, and see what I can sort out :) I just need more info.. On Jan 11, 2008, at 11:34 AM, Terry Calie wrote: Sorry if this is the wrong place to ask this question... if so please help me figure out where to ask it. I've asked on FireFox forums and was told it was a PHP problem and to ask the developers of PHP. I have a PHP website that freezes in Firefox on a Mac. Every other browser/operating system combination I have tested is fine. I've narrowed down the problem to having to do with session_start, which is the session tracking mechanism for php. When I comment out session_start, the site works (but of course my site now becomes state-less). Again, the problem is ONLY on FireFox on a Mac. It works fine on FireFox on a PC. Any ideas as to what could be causing the problem with FireFox on Mac and not on PC? (Safari on Mac works fine) Terry, I had seen your posts before (I'm a Mozilla developer as well), but I didn't see mention of a version. What Mac FF version are you using, and what plugins do you have installed? Try disabling all plugins, restarting Firefox, and seeing if it will work for you then. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
Daniel Brown wrote: [SNIPPED] Just keep in mind that anything that can be accessed by any means is never going to be 100% secure. I like the the line :) --Bipin Upadhyay, http://projectbee.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_start problems with FireFox on Mac
With a problem like that, code and a web page are very helpful to track it down. I'm willing to take a look at what I can with my Mac firefox, and see what I can sort out :) I just need more info.. On Jan 11, 2008, at 11:34 AM, Terry Calie wrote: Sorry if this is the wrong place to ask this question... if so please help me figure out where to ask it. I've asked on FireFox forums and was told it was a PHP problem and to ask the developers of PHP. I have a PHP website that freezes in Firefox on a Mac. Every other browser/operating system combination I have tested is fine. I've narrowed down the problem to having to do with session_start, which is the session tracking mechanism for php. When I comment out session_start, the site works (but of course my site now becomes state-less). Again, the problem is ONLY on FireFox on a Mac. It works fine on FireFox on a PC. Any ideas as to what could be causing the problem with FireFox on Mac and not on PC? (Safari on Mac works fine) Thanks, Terry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
On Jan 11, 2008 6:58 AM, Lucas Prado Melo [EMAIL PROTECTED] wrote: On Jan 11, 2008 9:33 AM, Bipin Upadhyay [EMAIL PROTECTED] wrote: Lucas Prado Melo wrote: Hello, Some php applications store database passwords into files which can be read by the user www-data. Why not keep them out of the web tree and inform the application regarding the same. I am sure almost all good applications would provide a simple way for doing it. So, a malicious user which can write php scripts could read those passwords. What should I do to prevent users from viewing those passwords? I am not sure I understand this. Do you mean the attacker would upload scripts and execute them to read th config files? If yes then that's a different problem altogether. Yes, I mean so. Make sure you change the permissions on the directory in which uploads are saved to be non-readable by anyone (including yourself, in case the scripts are suexec'd). For example, if the directory in which you save uploaded files is uploads/ then just do this (on a *nix box): chmod 300 uploads That way, files can still be saved to the directory (which requires write and execute privileges), but the files cannot be read or executed via the web, and directory listing is implicitly denied for all protocols (and local access) to anyone except root. To best-protect your configuration scripts, though, always place them outside of the web-accessible directories (for example, /home/user/config/) and include them properly. Also, make sure they are read-only (chmod 400, or chmod 444 if not using suexec). Beyond that, code obfuscation using Zend Optimizer (as was suggested) or an alternative would be your best bet. Just keep in mind that anything that can be accessed by any means is never going to be 100% secure. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
On Jan 11, 2008 9:33 AM, Bipin Upadhyay [EMAIL PROTECTED] wrote: Lucas Prado Melo wrote: Hello, Some php applications store database passwords into files which can be read by the user www-data. Why not keep them out of the web tree and inform the application regarding the same. I am sure almost all good applications would provide a simple way for doing it. So, a malicious user which can write php scripts could read those passwords. What should I do to prevent users from viewing those passwords? I am not sure I understand this. Do you mean the attacker would upload scripts and execute them to read th config files? If yes then that's a different problem altogether. Yes, I mean so. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is some_function()[some_index] invalid syntax?
Arlen Christian Mart Cuss schreef: Hi there, Why is it that if I try to evaluate an index of an array returned by a function immediately, a syntax error is produced? (unexpected '[', expecting ',' or ';') because it's not valid syntax. strangely enough php is neither insert other language here, nor is it capable of determine valid syntax based on a mind meld with the developer that wrote the code in question. but you knew that already really. Thanks, Arlen. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 1:22 PM, Jochem Maas [EMAIL PROTECTED] wrote: Eric Butera schreef: On Jan 11, 2008 11:33 AM, Stut [EMAIL PROTECTED] wrote: No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. Weird! I've never heard of that but I really don't doubt it. Working with e-mail is the least favorite part of my work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 11:36 AM, Richard Heyes [EMAIL PROTECTED] wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Thanks. Obviously, it will also make a huge difference between a local SMTP and remote SMTP. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Determine which are user defined keys?
joe and 0 are keys that I created whereas the key 1 and 2 are keys assigned by PHP when the array was created. When iterating through an array, is there a way to determine which were generated by PHP? I can't rely on whether or not the key is an integer because it's quite possible that such a key was user generated. I've gone through the docs and based on what I've read, I don't think something like this is possible but I'm hoping that's not the case. Any pointers? explain what your trying to achieve and why. because it seems like your 'requirement' is a result of tackling the problem from the wrong end. array_merge() clobbers the value of a particular key if that key exists in any of the arrays that appear later in the argument list for that function. If I want it so that I can merge arrays but make it so that all the values are retained, I need to write a function myself. So basically I end up with something that approximates: function array_merge_retain( $arr1, $arr2 ) { $retval = array(); foreach( $arr1 as $key = $val ) { $retval[$key][] = $val; } foreach( $arr2 as $key = $val ) { $retval[$key][] = $val; } return $retval; } (there would be a lot of other stuff going on, error checking and such, but the above is just bare bones). What that gives me is an array where the values for keys that appear in both arrays are retained. The above function is all well and fine, I suppose, but when the keys were created by PHP, I don't really care about retaining the key. If the key was created by PHP, i'd just do an array_push() instead of explicitly defining the key, as I am in the above function. That way, in the end, the merged array would contain arrays for values for only those keys that were user defined. Consider the following example: $myArr1 = array( 'joe' = 'bob', 0 = 'briggs', 'whatever', 'whereever'); $myArr2 = array( 'joe' = 'that', 0 = 'other', 'this', 'there'); the values 'whatever' and 'this' both have a key of 1 while 'wherever' and 'there' both have a key of 2. When merged, I envision the new array looking something like this: Array ( [joe] = array( bob, that ) [0] = array( briggs, other ) [1] = whatever [2] = whereever [3] = other [4] = there ) but my function above would create an array that looks like this: Array ( [joe] = array( bob, that ) [0] = array( briggs, other ) [1] = array( whatever, this ) [2] = array( whereever, there ) ) perhaps I am approaching this a$$backwards. I just wanted to keep the merged array in more or less the same form as the original arrays in the sense that those values that didn't originally have a user defined key are not grouped together like those that did originally have a user defined key. thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 1:33 PM, Richard Heyes [EMAIL PROTECTED] wrote: I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. IIRC htmlMimeMail use the PHP built in function to do quoted printable encoding. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** There is no such thing. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. IIRC htmlMimeMail use the PHP built in function to do quoted printable encoding. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A good book for a perspective programer.
I've been searching the web for all the tutorials I can on the subject of php programming, I don't think there is a limit on what is really available to learn. What I want to ask is if anyone can recommend a good/best text book to learn from, I like to have a good book on hand! I was going to purchase the Zen Study Guide but after some research I cam to the conclusion that this is not a good book to buy, or perhaps it is a good companion to my online studies? It's my understanding that this book would be best for me? PHP Objects, Patterns, and Practice, Second Edition http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_2?ie=UTF8s=booksqid=1200074884sr=1-2 Thanks in advance for advice with this! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Eric Butera schreef: On Jan 11, 2008 11:33 AM, Stut [EMAIL PROTECTED] wrote: No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Determine which are user defined keys?
Christoph Boget schreef: Given the following array: ?php $myArr = array( 'joe' = 'bob', 0 = 'briggs', 'whatever', 'whereever'); echo 'pre' . print_r( $myArr, TRUE ) . '/pre'; ? Array ( [joe] = bob [0] = briggs [1] = whatever [2] = whereever ) joe and 0 are keys that I created whereas the key 1 and 2 are keys assigned by PHP when the array was created. When iterating through an array, is there a way to determine which were generated by PHP? I can't rely on whether or not the key is an integer because it's quite possible that such a key was user generated. I've gone through the docs and based on what I've read, I don't think something like this is possible but I'm hoping that's not the case. Any pointers? explain what your trying to achieve and why. because it seems like your 'requirement' is a result of tackling the problem from the wrong end. thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A good book for a perspective programer.
I have learned PHP using PHP manual available at the www.php.net in chm format... You can also try.. my php free books collection here http://www.kingzones.org/bookszone/php.php But still I go with PHP manual... On Jan 11, 2008 11:42 PM, Sean-Michael [EMAIL PROTECTED] wrote: I've been searching the web for all the tutorials I can on the subject of php programming, I don't think there is a limit on what is really available to learn. What I want to ask is if anyone can recommend a good/best text book to learn from, I like to have a good book on hand! I was going to purchase the Zen Study Guide but after some research I cam to the conclusion that this is not a good book to buy, or perhaps it is a good companion to my online studies? It's my understanding that this book would be best for me? PHP Objects, Patterns, and Practice, Second Edition http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_2?ie=UTF8s=booksqid=1200074884sr=1-2 Thanks in advance for advice with this! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Visit: http://www.kingzones.org/
Re: [PHP] SMTP vs mail()
On 1/11/08, Richard Heyes [EMAIL PROTECTED] wrote: Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? For the amount of email I'm looking at (1000s, growing), yes. one word: phpmailer (http://phpmailer.codeworxtech.com/). seems like the best option. supports everything under the sun. even phplist (which itself seems awesome) uses it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Hello, on 01/11/2008 04:22 PM Jochem Maas said the following: Eric Butera schreef: On Jan 11, 2008 11:33 AM, Stut [EMAIL PROTECTED] wrote: No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. That is one more reason to not use SMTP connections for queueing many messages. If you use sendmail or equivalent and the MTA is properly configured, there will be no SMTP disconnect and reconnects to deal with. Using SMTP is simply a bad idea unless your MTA is in a separate machine. Personally I use qmail. It never establishes SMTP connections when you are queueing messages. When I want to deliver messages to many recipients I call the qmail-inject program directly, instead of Qmail sendmail wrapper that is used by the mail function by default. Actually I use the MIME message package that comes with drivers specialize in qmail, sendmail, SMTP and mail. Each driver carries its bag of tricks to optimize deliveries among other options to speedup bulk-mailing in general. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
If you have your sendmail equivalent program properly configured, no SMTP connection is used when queueing messages using the sendmail program. What about when you take into consideration this program could be sending 1000's of emails, say, 100 per SMTP connection? -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? For the amount of email I'm looking at (1000s, growing), yes. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Posting Summary for Week Ending 11 January, 2008: php-general@lists.php.net
Posting Summary for PHP-General List Week Ending: Friday, 11 January, 2008 Messages| Bytes | Sender +-+-- 226 (100%) 255776 (100%) EVERYONE 81(0.36%) 43996(0.17%) PostTrack [Dan Brown] [EMAIL PROTECTED] 20(0.09%) 23643(0.09%) Daniel Brown [EMAIL PROTECTED] 11(0.05%) 5291(0.02%) PostTrack [Dan Brown] [EMAIL PROTECTED] 8(0.04%) 11635(0.05%) tedd [EMAIL PROTECTED] 5(0.02%) 4685(0.02%) John Gunther [EMAIL PROTECTED] 5(0.02%) 2946(0.01%) Chris [EMAIL PROTECTED] 4(0.02%) 4793(0.02%) A.smith [EMAIL PROTECTED] 4(0.02%) 5191(0.02%) Afan Pasalic [EMAIL PROTECTED] 4(0.02%) 6792(0.03%) Alain Roger [EMAIL PROTECTED] 4(0.02%) 9012(0.04%) mike [EMAIL PROTECTED] 4(0.02%) 5485(0.02%) chris smith [EMAIL PROTECTED] 4(0.02%) 6038(0.02%) jekillen [EMAIL PROTECTED] 3(0.01%) 5749(0.02%) Casey [EMAIL PROTECTED] 3(0.01%) 10120(0.04%) Nisse =?utf-8?Q?Engstr=C3=B6m?= [EMAIL PROTECTED] 3(0.01%) 6216(0.02%) Simon Welsh [EMAIL PROTECTED] 3(0.01%) 5666(0.02%) TG [EMAIL PROTECTED] 3(0.01%) 7811(0.03%) Miren Urkixo [EMAIL PROTECTED] 2(0.01%) 4533(0.02%) Steve Finkelstein [EMAIL PROTECTED] 2(0.01%) 4335(0.02%) Nathan Nobbe [EMAIL PROTECTED] 2(0.01%) 2047(0.01%) Leonidas Safran [EMAIL PROTECTED] 2(0.01%) 580(0%) Wan Chaowei [EMAIL PROTECTED] 2(0.01%) 1516(0.01%) steve [EMAIL PROTECTED] 2(0.01%) 1555(0.01%) =?ISO-8859-1?Q?Olav_M=F8rkrid?= [EMAIL PROTECTED] 2(0.01%) 3475(0.01%) Bastien Koert [EMAIL PROTECTED] 2(0.01%) 2457(0.01%) peeyush gulati [EMAIL PROTECTED] 2(0.01%) 3623(0.01%) Jim Lucas [EMAIL PROTECTED] 2(0.01%) 2870(0.01%) Dave Goodchild [EMAIL PROTECTED] 2(0.01%) 1180(0%) Per Jessen [EMAIL PROTECTED] 2(0.01%) 3291(0.01%) Manuel Lemos [EMAIL PROTECTED] 2(0.01%) 3129(0.01%) Richard Lynch [EMAIL PROTECTED] 2(0.01%) 3915(0.02%) =?ISO-8859-1?Q?=D3lafur_Waage?= [EMAIL PROTECTED] 2(0.01%) 1952(0.01%) Warren Vail [EMAIL PROTECTED] 1(0%) 1611(0.01%) Andy Smith [EMAIL PROTECTED] 1(0%) 1768(0.01%) Robert Cummings [EMAIL PROTECTED] 1(0%) 922(0%) [EMAIL PROTECTED] [EMAIL PROTECTED] 1(0%) 1808(0.01%) Larry Garfield [EMAIL PROTECTED] 1(0%) 2188(0.01%) Mary Anderson [EMAIL PROTECTED] 1(0%) 1467(0.01%) Anup Shukla [EMAIL PROTECTED] 1(0%) 468(0%) Al [EMAIL PROTECTED] 1(0%) 486(0%) tedd [EMAIL PROTECTED] 1(0%) 689(0%) Richard Heyes [EMAIL PROTECTED] 1(0%) 1381(0.01%) =?ISO-8859-1?Q?Zolt=E1n_N=E9meth?= [EMAIL PROTECTED] 1(0%) 737(0%) Christoph Boget [EMAIL PROTECTED] 1(0%) 1584(0.01%) Cyril Chacko [EMAIL PROTECTED] 1(0%) 4562(0.02%) [EMAIL PROTECTED] 1(0%) 2125(0.01%) Yang Yang [EMAIL PROTECTED] 1(0%) 885(0%) Balasubramanyam A [EMAIL PROTECTED] 1(0%) 1746(0.01%) =?iso-8859-1?q?B=F8rge_Holen?= [EMAIL PROTECTED] 1(0%) 640(0%) Reese [EMAIL PROTECTED] 1(0%) 2872(0.01%) Yui Hiroaki [EMAIL PROTECTED] 1(0%) 3311(0.01%) =?utf-8?q?B=C3=B8rge_Holen?= [EMAIL PROTECTED] 1(0%) 644(0%) Brady Mitchell [EMAIL PROTECTED] 1(0%) 1972(0.01%) =?iso-8859-1?Q?Andr=E9s_Robinet?= [EMAIL PROTECTED] 1(0%) 3693(0.01%) Miles Thompson [EMAIL PROTECTED] 1(0%) 1302(0.01%) Colin Guthrie [EMAIL PROTECTED] 1(0%) 602(0%) Breno [EMAIL PROTECTED] 1(0%) 191(0%) Sancar Saran [EMAIL PROTECTED] 1(0%) 9670(0.04%) 00225 1043287 [EMAIL PROTECTED] 1(0%) 925(0%) Xavier Casto [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Determine which are user defined keys?
Christoph Boget schreef: joe and 0 are keys that I created whereas the key 1 and 2 are ... php doesn't differentiate between numeric [integer] strings and actual integers with regard to array keys. herein lies the 'problem' ) but my function above would create an array that looks like this: Array ( [joe] = array( bob, that ) [0] = array( briggs, other ) [1] = array( whatever, this ) [2] = array( whereever, there ) ) perhaps I am approaching this a$$backwards. I just wanted to keep the merged array in more or less the same form as the original arrays in the sense that those values that didn't originally have a user defined key are not grouped together like those that did originally have a user defined key. where do these arrays come from? why is it important to differentiate between 'user keys' and 'php keys'? if the difference is important maybe you need to think about creating a different data structure to start with e.g. $a = array( array(key = joe, val = bob), array(key = 0, val = briggs), array(key = null, val = whatever), array(key = null, val = whatever), ); $b = array( array(key = joe, val = that), array(key = 0, val = other), array(key = null, val = this), array(key = null, val = there), ); $r = array(); foreach(array($a, $b) as $arr) foreach($arr as $tmp) if (!is_null($tmp[key])) $r[$tmp[key]][] = $tmp[val]; else $r[] = $tmp[val]; foreach($r as $k = $v) if (is_array($v) count($v) == 1) $r[$k] = $v[0]; var_dump($r); still it would help if you could explain why you need this, and why you have 'inappropriate' data structures to start with ... as I mentioned already, you can't differentiate between an automatically created numeric index and a user defined associative index that happens to be equivalent to an integer. thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 11 January, 2008: php-general@lists.php.net
On Jan 11, 2008 4:11 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hate to shot a hole in your script Dan... But my posts aren't listed :P and I had a few on Jan 8 :) Where should I file a bug report? Well, that's the other interesting thing. As Tedd and David from the list know, on the morning of 8 January, there was a total disk failure, which was immediately followed by some sort of miscommunication at the datacenter. The server just finally had the drive replaced and the server placed back online this afternoon. So we'll apparently have to wait until next week to see accurate weekly results. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
Hello, on 01/11/2008 06:03 PM Richard Heyes said the following: If you have your sendmail equivalent program properly configured, no SMTP connection is used when queueing messages using the sendmail program. What about when you take into consideration this program could be sending 1000's of emails, say, 100 per SMTP connection? That is even worse. Keep in mind that the SMTP server of sendmail or equivalent MTA, ends up calling the sendmail program for each individual message that it receives. It is the same operation, except that you are communication directly with the sendmail program with pipes when you use mail(), and when you use SMTP it uses SMTP connection that triggers sendmail program calls to actually queue the message instead of attempting to to deliver it. The bottom line, if you use qmail, postfix, or sendmail configured to queue the messages (instead of attempting to deliver them) you will always be much faster queueing messages. Just watch out your server disk space and CPU when you are attempting to deliver too many messages. -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
There is no such thing. :) Perhaps not then... :-) -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
Richard Heyes wrote: If you have your sendmail equivalent program properly configured, no SMTP connection is used when queueing messages using the sendmail program. What about when you take into consideration this program could be sending 1000's of emails, say, 100 per SMTP connection? In my head, I almost always envision an SMTP server being a separate box from the web server. If this is the case, properly configured local sendmail usage is going to be way faster then a remote SMTP connection. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
Manuel Lemos wrote: On Linux/Unix, mail() uses sendmail or equivalent programs. These programs use pipes to communicate, which are much faster than using SMTP TCP sockets. Uh, sendmail on unix typically just drops the email file into a directory for the mailer daemon to pick up from. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 11 January, 2008: php-general@lists.php.net
THAT was the way it was supposed to work. Though in all of the chaos, I forgot to fix the percentage factoring. Anyway, it will be one message sent at 4:00p on Friday each week, and that's all. Not 92 messages sent on one day. Sorry about that again :-( On Jan 11, 2008 4:00 PM, PostTrack [Dan Brown] [EMAIL PROTECTED] wrote: Posting Summary for PHP-General List Week Ending: Friday, 11 January, 2008 Messages| Bytes | Sender +-+-- 226 (100%) 255776 (100%) EVERYONE 81(0.36%) 43996(0.17%) PostTrack [Dan Brown] [EMAIL PROTECTED] 20(0.09%) 23643(0.09%) Daniel Brown [EMAIL PROTECTED] 11(0.05%) 5291(0.02%) PostTrack [Dan Brown] [EMAIL PROTECTED] 8(0.04%) 11635(0.05%) tedd [EMAIL PROTECTED] 5(0.02%) 4685(0.02%) John Gunther [EMAIL PROTECTED] 5(0.02%) 2946(0.01%) Chris [EMAIL PROTECTED] 4(0.02%) 4793(0.02%) A.smith [EMAIL PROTECTED] 4(0.02%) 5191(0.02%) Afan Pasalic [EMAIL PROTECTED] 4(0.02%) 6792(0.03%) Alain Roger [EMAIL PROTECTED] 4(0.02%) 9012(0.04%) mike [EMAIL PROTECTED] 4(0.02%) 5485(0.02%) chris smith [EMAIL PROTECTED] 4(0.02%) 6038(0.02%) jekillen [EMAIL PROTECTED] 3(0.01%) 5749(0.02%) Casey [EMAIL PROTECTED] 3(0.01%) 10120(0.04%) Nisse =?utf-8?Q?Engstr=C3=B6m?= [EMAIL PROTECTED] 3(0.01%) 6216(0.02%) Simon Welsh [EMAIL PROTECTED] 3(0.01%) 5666(0.02%) TG [EMAIL PROTECTED] 3(0.01%) 7811(0.03%) Miren Urkixo [EMAIL PROTECTED] 2(0.01%) 4533(0.02%) Steve Finkelstein [EMAIL PROTECTED] 2(0.01%) 4335(0.02%) Nathan Nobbe [EMAIL PROTECTED] 2(0.01%) 2047(0.01%) Leonidas Safran [EMAIL PROTECTED] 2(0.01%) 580(0%) Wan Chaowei [EMAIL PROTECTED] 2(0.01%) 1516(0.01%) steve [EMAIL PROTECTED] 2(0.01%) 1555(0.01%) =?ISO-8859-1?Q?Olav_M=F8rkrid?= [EMAIL PROTECTED] 2(0.01%) 3475(0.01%) Bastien Koert [EMAIL PROTECTED] 2(0.01%) 2457(0.01%) peeyush gulati [EMAIL PROTECTED] 2(0.01%) 3623(0.01%) Jim Lucas [EMAIL PROTECTED] 2(0.01%) 2870(0.01%) Dave Goodchild [EMAIL PROTECTED] 2(0.01%) 1180(0%) Per Jessen [EMAIL PROTECTED] 2(0.01%) 3291(0.01%) Manuel Lemos [EMAIL PROTECTED] 2(0.01%) 3129(0.01%) Richard Lynch [EMAIL PROTECTED] 2(0.01%) 3915(0.02%) =?ISO-8859-1?Q?=D3lafur_Waage?= [EMAIL PROTECTED] 2(0.01%) 1952(0.01%) Warren Vail [EMAIL PROTECTED] 1(0%) 1611(0.01%) Andy Smith [EMAIL PROTECTED] 1(0%) 1768(0.01%) Robert Cummings [EMAIL PROTECTED] 1(0%) 922(0%) [EMAIL PROTECTED] [EMAIL PROTECTED] 1(0%) 1808(0.01%) Larry Garfield [EMAIL PROTECTED] 1(0%) 2188(0.01%) Mary Anderson [EMAIL PROTECTED] 1(0%) 1467(0.01%) Anup Shukla [EMAIL PROTECTED] 1(0%) 468(0%) Al [EMAIL PROTECTED] 1(0%) 486(0%) tedd [EMAIL PROTECTED] 1(0%) 689(0%) Richard Heyes [EMAIL PROTECTED] 1(0%) 1381(0.01%) =?ISO-8859-1?Q?Zolt=E1n_N=E9meth?= [EMAIL PROTECTED] 1(0%) 737(0%) Christoph Boget [EMAIL PROTECTED] 1(0%) 1584(0.01%) Cyril Chacko [EMAIL PROTECTED] 1(0%) 4562(0.02%) [EMAIL PROTECTED] 1(0%) 2125(0.01%) Yang Yang [EMAIL PROTECTED] 1(0%) 885(0%) Balasubramanyam A [EMAIL PROTECTED] 1(0%) 1746(0.01%) =?iso-8859-1?q?B=F8rge_Holen?= [EMAIL PROTECTED] 1(0%) 640(0%) Reese [EMAIL PROTECTED] 1(0%) 2872(0.01%) Yui Hiroaki [EMAIL PROTECTED] 1(0%) 3311(0.01%) =?utf-8?q?B=C3=B8rge_Holen?= [EMAIL PROTECTED] 1(0%) 644(0%) Brady Mitchell [EMAIL PROTECTED] 1(0%) 1972(0.01%) =?iso-8859-1?Q?Andr=E9s_Robinet?= [EMAIL PROTECTED] 1(0%) 3693(0.01%) Miles Thompson [EMAIL PROTECTED] 1(0%) 1302(0.01%) Colin Guthrie [EMAIL
Re: [PHP] Determine which are user defined keys?
On Jan 11, 2008 1:17 PM, Jochem Maas [EMAIL PROTECTED] wrote: explain what your trying to achieve and why. because it seems like your 'requirement' is a result of tackling the problem from the wrong end. I'd wait and listen to what Jochem has to say first, but you might be able to keep a copy of your original array and do some sort of array_diff to find out what what changed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ldap_bind() issue
On Fri, January 11, 2008 11:44 am, Greg Donald wrote: I really have NO IDEA, but... ldap_int_sasl_open: host=ldap.example.com TLS certificate verification: depth: 0, err: 66, subject: C=US,ST=SomeState,O=SomeCompany,CN=ldap.example.com, issuer: C=US,O=Equifax,OU=Equifax Secure Certificate Authority TLS certificate verification: Error, Unknown error TLS: can't connect. ldap_err2string This strikes me as if you've got a Private/Public key issue where you neglected to generate/install a key-pair... Or did you sanitize this before you posted?... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
On Jan 11, 2008 2:16 PM, Daniel Brown [EMAIL PROTECTED] wrote: Make sure you change the permissions on the directory in which uploads are saved to be non-readable by anyone (including yourself, in case the scripts are suexec'd). For example, if the directory in which you save uploaded files is uploads/ then just do this (on a *nix box): chmod 300 uploads That way, files can still be saved to the directory (which requires write and execute privileges), but the files cannot be read or executed via the web, and directory listing is implicitly denied for all protocols (and local access) to anyone except root. The uploaded scripts must be executed via the web because it's a host... Maybe we could prevent scripts from certain folders to see other folders... (chroot?) Do you know how to do it in apache? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 11 January, 2008: php-general@lists.php.net
On Jan 11, 2008 4:44 PM, Wolf [EMAIL PROTECTED] wrote: I dunno Dan, my posts aren't showing up in the list, and this tracker has 92 of the 226 posts... ;) Like I told Jason a little bit ago, there was a total drive failure on that server on 8 January, which the datacenter didn't have resolved until this afternoon. Leaving the obvious point of there being no excuse for that by any half-decent NOC, that's the reason for the missing posts. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ldap_bind() issue
On 1/11/08, Richard Lynch [EMAIL PROTECTED] wrote: This strikes me as if you've got a Private/Public key issue where you neglected to generate/install a key-pair... Yeah, the certificate error message makes me think something is not right with my PHP install or how it's talking to the OpenLDAP libs.. but what exactly is the mystery. ldap_bind()'s Error unknown message isn't very helpful. Meanwhile another project of mine, on that same server, uses ruby-ldap and works just fine. Or did you sanitize this before you posted?... Had to, yes. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is some_function()[some_index] invalid syntax?
Nathan Nobbe wrote: On Jan 11, 2008 3:45 AM, Zoltán Németh [EMAIL PROTECTED] wrote: and call it Java ;) or perhaps javascript :) function cool() { return [1, 2, 3]; } alert(cool()[0]); -nathan or Ruby -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Hello, on 01/11/2008 02:33 PM Stut said the following: Richard Heyes wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. That is not true. SMTP connections are much slower than calling the sendmail program because calling sendmail uses pipes to communicate and SMTP requires an TCP connection, even if it is to the same machine. Your problem is that you have sendmail in the default configuration, which makes it attempt to deliver the messages when you call it. That is why it was taking too long to send all your messages. You need to configure it to queue the messages locally, instead of attempting to deliver right away. One solution is to use a better MTA like qmail or postfix. If you are stuck with sendmail and you cannot change its default configuration, there are some options to configure it per delivery. Take a look at this message composing and sending package class. It provides some options to optimize the message delivery back end to speed up message queueing. The sendmail backend takes great advantage of these options. Take a look in particular at the script test_personalized_bulk_mail.php . http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 11:33 AM, Stut [EMAIL PROTECTED] wrote: No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ldap_bind() issue
Hello, I'm tasked with writing an application in PHP that will authenticate against a known working LDAP server. I'm having some problems binding against that LDAP server and cannot find the issue. I can telnet to the LDAP server's IP and port: telnet 12.34.56.78 636 Trying 12.34.56.78... Connected to 12.34.56.78. Escape character is '^]'. ^] telnet quit Connection closed. So I have more or less ruled out any sort of networking issue. But then when trying ldapsearch, this command is failing: ldapsearch -h 12.34.56.78 -p 626 -v -W -X dn:uid=username,ou=people,dc=example,dc=com ldap_initialize( ldap://12.34.56.78:626 ) Enter LDAP Password: ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1) It could be that I'm not providing the correct options as I'm not extremely familiar with ldapsearch. And then the heart of the issue, this simple PHP script is also failing for me: ./ldap_test.php ldap_create ldap_url_parse_ext(LDAPS://ldap.example.com) ldap_bind_s ldap_simple_bind_s ldap_sasl_bind_s ldap_sasl_bind ldap_send_initial_request ldap_new_connection ldap_int_open_connection ldap_connect_to_host: TCP ldap.example.com:636 ldap_new_socket: 3 ldap_prepare_socket: 3 ldap_connect_to_host: Trying 12.34.56.78:636 ldap_connect_timeout: fd: 3 tm: -1 async: 0 ldap_ndelay_on: 3 ldap_is_sock_ready: 3 ldap_ndelay_off: 3 ldap_int_sasl_open: host=ldap.example.com TLS certificate verification: depth: 0, err: 66, subject: C=US,ST=SomeState,O=SomeCompany,CN=ldap.example.com, issuer: C=US,O=Equifax,OU=Equifax Secure Certificate Authority TLS certificate verification: Error, Unknown error TLS: can't connect. ldap_err2string The contents of my PHP test script: error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, 7 ); $c = ldap_connect( 'LDAPS://ldap.example.com', 636 ) or die( 'Could not connect to LDAP server.' ); if( ldap_bind( $c, uid=username,ou=people,dc=example,dc=com, 'xxx' ) ){ echo 'success!'; } else { echo 'failed to bind'; } The PHP on my local Ubuntu box currently only has the --with-ldap option configured as I'm trying to rule out other libraries that may possibly be causing issues. Are there other dependencies I must build into my PHP to connect using ldap_bind() ? I have experimented with adding --with-openssl and --with-ldap-sasl support but neither resolved my issue. It's also worth mentioning I am building my PHP against the OpenLDAP libraries provided in my Linux distro: dpkg -l|grep ldap ii ldap-utils 2.3.35-1ubuntu0.1 OpenLDAP utilities ii libldap-2.3-0 2.3.35-1ubuntu0.1 OpenLDAP libraries ii libldap2 2.1.30-13.4 OpenLDAP libraries ii libldap2-dev 2.1.30-13.4 OpenLDAP development libraries There are of course other ldap libraries available but I have no idea if I need them or not. Seems everyone is building their PHP against OpenLDAP so that's what I'm trying to use too. I ran ldconfig after installing the above libraries and they seem to be found with no problems during configuration and compilation. Any idea what might be the problem or what else I can try? I've already tried everything Google has to offer on the issue and am still stuck. Thanks, -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SMTP vs mail()
Hello, on 01/11/2008 02:29 PM Richard Heyes said the following: Hi, Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? It depends on the platform you are running PHP. There is a myth by which people believe that using mail() is slower than using SMTP connections. Some of those people using PHP on Windows (especially for development). On Windows, mail() uses SMTP connections. On Linux/Unix, mail() uses sendmail or equivalent programs. These programs use pipes to communicate, which are much faster than using SMTP TCP sockets. If you have your sendmail equivalent program properly configured, no SMTP connection is used when queueing messages using the sendmail program. -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SMTP vs mail()
Hi, Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? Thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 1:26 PM, Eric Butera [EMAIL PROTECTED] wrote: Weird! I've never heard of that but I really don't doubt it. Working with e-mail is the least favorite part of my work. he said, via email. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_start problems with FireFox on Mac
Sorry if this is the wrong place to ask this question... if so please help me figure out where to ask it. I've asked on FireFox forums and was told it was a PHP problem and to ask the developers of PHP. I have a PHP website that freezes in Firefox on a Mac. Every other browser/operating system combination I have tested is fine. I've narrowed down the problem to having to do with session_start, which is the session tracking mechanism for php. When I comment out session_start, the site works (but of course my site now becomes state-less). Again, the problem is ONLY on FireFox on a Mac. It works fine on FireFox on a PC. Any ideas as to what could be causing the problem with FireFox on Mac and not on PC? (Safari on Mac works fine) Thanks, Terry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 11 January, 2008: php-general@lists.php.net
I dunno Dan, my posts aren't showing up in the list, and this tracker has 92 of the 226 posts... ;) PostTrack [Dan Brown] [EMAIL PROTECTED] wrote: Posting Summary for PHP-General List Week Ending: Friday, 11 January, 2008 Messages| Bytes | Sender +-+-- 226 (100%) 255776 (100%) EVERYONE 81(0.36%) 43996(0.17%) PostTrack [Dan Brown] [EMAIL PROTECTED] 20(0.09%) 23643(0.09%) Daniel Brown [EMAIL PROTECTED] 11(0.05%) 5291(0.02%) PostTrack [Dan Brown] [EMAIL PROTECTED] 8(0.04%) 11635(0.05%) tedd [EMAIL PROTECTED] 5(0.02%) 4685(0.02%) John Gunther [EMAIL PROTECTED] 5(0.02%) 2946(0.01%) Chris [EMAIL PROTECTED] 4(0.02%) 4793(0.02%) A.smith [EMAIL PROTECTED] 4(0.02%) 5191(0.02%) Afan Pasalic [EMAIL PROTECTED] 4(0.02%) 6792(0.03%) Alain Roger [EMAIL PROTECTED] 4(0.02%) 9012(0.04%) mike [EMAIL PROTECTED] 4(0.02%) 5485(0.02%) chris smith [EMAIL PROTECTED] 4(0.02%) 6038(0.02%) jekillen [EMAIL PROTECTED] 3(0.01%) 5749(0.02%) Casey [EMAIL PROTECTED] 3(0.01%) 10120(0.04%) Nisse =?utf-8?Q?Engstr=C3=B6m?= [EMAIL PROTECTED] 3(0.01%) 6216(0.02%) Simon Welsh [EMAIL PROTECTED] 3(0.01%) 5666(0.02%) TG [EMAIL PROTECTED] 3(0.01%) 7811(0.03%) Miren Urkixo [EMAIL PROTECTED] 2(0.01%) 4533(0.02%) Steve Finkelstein [EMAIL PROTECTED] 2(0.01%) 4335(0.02%) Nathan Nobbe [EMAIL PROTECTED] 2(0.01%) 2047(0.01%) Leonidas Safran [EMAIL PROTECTED] 2(0.01%) 580(0%) Wan Chaowei [EMAIL PROTECTED] 2(0.01%) 1516(0.01%) steve [EMAIL PROTECTED] 2(0.01%) 1555(0.01%) =?ISO-8859-1?Q?Olav_M=F8rkrid?= [EMAIL PROTECTED] 2(0.01%) 3475(0.01%) Bastien Koert [EMAIL PROTECTED] 2(0.01%) 2457(0.01%) peeyush gulati [EMAIL PROTECTED] 2(0.01%) 3623(0.01%) Jim Lucas [EMAIL PROTECTED] 2(0.01%) 2870(0.01%) Dave Goodchild [EMAIL PROTECTED] 2(0.01%) 1180(0%) Per Jessen [EMAIL PROTECTED] 2(0.01%) 3291(0.01%) Manuel Lemos [EMAIL PROTECTED] 2(0.01%) 3129(0.01%) Richard Lynch [EMAIL PROTECTED] 2(0.01%) 3915(0.02%) =?ISO-8859-1?Q?=D3lafur_Waage?= [EMAIL PROTECTED] 2(0.01%) 1952(0.01%) Warren Vail [EMAIL PROTECTED] 1(0%) 1611(0.01%) Andy Smith [EMAIL PROTECTED] 1(0%) 1768(0.01%) Robert Cummings [EMAIL PROTECTED] 1(0%) 922(0%) [EMAIL PROTECTED] [EMAIL PROTECTED] 1(0%) 1808(0.01%) Larry Garfield [EMAIL PROTECTED] 1(0%) 2188(0.01%) Mary Anderson [EMAIL PROTECTED] 1(0%) 1467(0.01%) Anup Shukla [EMAIL PROTECTED] 1(0%) 468(0%) Al [EMAIL PROTECTED] 1(0%) 486(0%) tedd [EMAIL PROTECTED] 1(0%) 689(0%) Richard Heyes [EMAIL PROTECTED] 1(0%) 1381(0.01%) =?ISO-8859-1?Q?Zolt=E1n_N=E9meth?= [EMAIL PROTECTED] 1(0%) 737(0%) Christoph Boget [EMAIL PROTECTED] 1(0%) 1584(0.01%) Cyril Chacko [EMAIL PROTECTED] 1(0%) 4562(0.02%) [EMAIL PROTECTED] 1(0%) 2125(0.01%) Yang Yang [EMAIL PROTECTED] 1(0%) 885(0%) Balasubramanyam A [EMAIL PROTECTED] 1(0%) 1746(0.01%) =?iso-8859-1?q?B=F8rge_Holen?= [EMAIL PROTECTED] 1(0%) 640(0%) Reese [EMAIL PROTECTED] 1(0%) 2872(0.01%) Yui Hiroaki [EMAIL PROTECTED] 1(0%) 3311(0.01%) =?utf-8?q?B=C3=B8rge_Holen?= [EMAIL PROTECTED] 1(0%) 644(0%) Brady Mitchell [EMAIL PROTECTED] 1(0%) 1972(0.01%) =?iso-8859-1?Q?Andr=E9s_Robinet?= [EMAIL PROTECTED] 1(0%) 3693(0.01%) Miles Thompson [EMAIL PROTECTED] 1(0%) 1302(0.01%) Colin Guthrie [EMAIL PROTECTED] 1(0%) 602(0%) Breno [EMAIL PROTECTED] 1(0%) 191(0%) Sancar Saran [EMAIL PROTECTED] 1(0%) 9670(0.04%) 00225 1043287 [EMAIL PROTECTED] 1(0%) 925(0%) Xavier Casto [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/)
Re: [PHP] Posting Summary for Week Ending 11 January, 2008: php-general@lists.php.net
Hate to shot a hole in your script Dan... But my posts aren't listed :P and I had a few on Jan 8 :) Where should I file a bug report? On Jan 11, 2008, at 4:00 PM, PostTrack [Dan Brown] wrote: Posting Summary for PHP-General List Week Ending: Friday, 11 January, 2008 Messages| Bytes | Sender +-+-- 226 (100%) 255776 (100%) EVERYONE 81(0.36%) 43996(0.17%) PostTrack [Dan Brown] [EMAIL PROTECTED] 20(0.09%) 23643(0.09%) Daniel Brown [EMAIL PROTECTED] 11(0.05%) 5291(0.02%) PostTrack [Dan Brown] [EMAIL PROTECTED] 8(0.04%) 11635(0.05%) tedd [EMAIL PROTECTED] 5(0.02%) 4685(0.02%) John Gunther [EMAIL PROTECTED] 5(0.02%) 2946(0.01%) Chris [EMAIL PROTECTED] 4(0.02%) 4793(0.02%) A.smith [EMAIL PROTECTED] 4(0.02%) 5191(0.02%) Afan Pasalic [EMAIL PROTECTED] 4(0.02%) 6792(0.03%) Alain Roger [EMAIL PROTECTED] 4(0.02%) 9012(0.04%) mike [EMAIL PROTECTED] 4(0.02%) 5485(0.02%) chris smith [EMAIL PROTECTED] 4(0.02%) 6038(0.02%) jekillen [EMAIL PROTECTED] 3(0.01%) 5749(0.02%) Casey [EMAIL PROTECTED] 3(0.01%) 10120(0.04%) Nisse =?utf-8?Q? Engstr=C3=B6m?= [EMAIL PROTECTED] 3(0.01%) 6216(0.02%) Simon Welsh [EMAIL PROTECTED] 3(0.01%) 5666(0.02%) TG [EMAIL PROTECTED] 3(0.01%) 7811(0.03%) Miren Urkixo [EMAIL PROTECTED] 2(0.01%) 4533(0.02%) Steve Finkelstein [EMAIL PROTECTED] 2(0.01%) 4335(0.02%) Nathan Nobbe [EMAIL PROTECTED] 2(0.01%) 2047(0.01%) Leonidas Safran [EMAIL PROTECTED] 2(0.01%) 580(0%) Wan Chaowei [EMAIL PROTECTED] 2(0.01%) 1516(0.01%) steve [EMAIL PROTECTED] 2(0.01%) 1555(0.01%) =?ISO-8859-1?Q? Olav_M=F8rkrid?= [EMAIL PROTECTED] 2(0.01%) 3475(0.01%) Bastien Koert [EMAIL PROTECTED] 2(0.01%) 2457(0.01%) peeyush gulati [EMAIL PROTECTED] 2(0.01%) 3623(0.01%) Jim Lucas [EMAIL PROTECTED] 2(0.01%) 2870(0.01%) Dave Goodchild [EMAIL PROTECTED] 2(0.01%) 1180(0%) Per Jessen [EMAIL PROTECTED] 2(0.01%) 3291(0.01%) Manuel Lemos [EMAIL PROTECTED] 2(0.01%) 3129(0.01%) Richard Lynch [EMAIL PROTECTED] e.com 2(0.01%) 3915(0.02%) =?ISO-8859-1?Q? =D3lafur_Waage?= [EMAIL PROTECTED] 2(0.01%) 1952(0.01%) Warren Vail [EMAIL PROTECTED] 1(0%) 1611(0.01%) Andy Smith [EMAIL PROTECTED] 1(0%) 1768(0.01%) Robert Cummings [EMAIL PROTECTED] 1(0%) 922(0%) [EMAIL PROTECTED] [EMAIL PROTECTED] 1(0%) 1808(0.01%) Larry Garfield [EMAIL PROTECTED] 1(0%) 2188(0.01%) Mary Anderson [EMAIL PROTECTED] 1(0%) 1467(0.01%) Anup Shukla [EMAIL PROTECTED] 1(0%) 468(0%) Al [EMAIL PROTECTED] 1(0%) 486(0%) tedd [EMAIL PROTECTED] 1(0%) 689(0%) Richard Heyes [EMAIL PROTECTED] 1(0%) 1381(0.01%) =?ISO-8859-1?Q? Zolt=E1n_N=E9meth?= [EMAIL PROTECTED] 1(0%) 737(0%) Christoph Boget [EMAIL PROTECTED] 1(0%) 1584(0.01%) Cyril Chacko [EMAIL PROTECTED] 1(0%) 4562(0.02%) [EMAIL PROTECTED] 1(0%) 2125(0.01%) Yang Yang [EMAIL PROTECTED] 1(0%) 885(0%) Balasubramanyam A [EMAIL PROTECTED] 1(0%) 1746(0.01%) =?iso-8859-1?q?B=F8rge_Holen?= [EMAIL PROTECTED] 1(0%) 640(0%) Reese [EMAIL PROTECTED] 1(0%) 2872(0.01%) Yui Hiroaki [EMAIL PROTECTED] 1(0%) 3311(0.01%) =?utf-8?q?B=C3=B8rge_Holen?= [EMAIL PROTECTED] 1(0%) 644(0%) Brady Mitchell [EMAIL PROTECTED] 1(0%) 1972(0.01%) =?iso-8859-1?Q?Andr=E9s_Robinet? = [EMAIL PROTECTED] 1(0%) 3693(0.01%) Miles Thompson [EMAIL PROTECTED] 1(0%) 1302(0.01%) Colin Guthrie [EMAIL PROTECTED] 1(0%) 602(0%) Breno [EMAIL PROTECTED] 1(0%) 191(0%) Sancar Saran [EMAIL PROTECTED] 1(0%) 9670(0.04%) 00225 1043287 [EMAIL PROTECTED] 1(0%) 925(0%) Xavier Casto [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Pruim Raoset Inc. Technology Manager MQC
Re: [PHP] PHP shell commands
To fix this scenerio, chroot would require different apache processes running under different users. On Jan 11, 2008 3:46 PM, Lucas Prado Melo [EMAIL PROTECTED] wrote: On Jan 11, 2008 2:16 PM, Daniel Brown [EMAIL PROTECTED] wrote: Make sure you change the permissions on the directory in which uploads are saved to be non-readable by anyone (including yourself, in case the scripts are suexec'd). For example, if the directory in which you save uploaded files is uploads/ then just do this (on a *nix box): chmod 300 uploads That way, files can still be saved to the directory (which requires write and execute privileges), but the files cannot be read or executed via the web, and directory listing is implicitly denied for all protocols (and local access) to anyone except root. The uploaded scripts must be executed via the web because it's a host... Maybe we could prevent scripts from certain folders to see other folders... (chroot?) Do you know how to do it in apache? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_start problems with FireFox on Mac
Install Live HTTP Headers and see what headers are being sent. Then search for those headers and FireFox Mac issues online. On Fri, January 11, 2008 10:34 am, Terry Calie wrote: Sorry if this is the wrong place to ask this question... if so please help me figure out where to ask it. I've asked on FireFox forums and was told it was a PHP problem and to ask the developers of PHP. I have a PHP website that freezes in Firefox on a Mac. Every other browser/operating system combination I have tested is fine. I've narrowed down the problem to having to do with session_start, which is the session tracking mechanism for php. When I comment out session_start, the site works (but of course my site now becomes state-less). Again, the problem is ONLY on FireFox on a Mac. It works fine on FireFox on a PC. Any ideas as to what could be causing the problem with FireFox on Mac and not on PC? (Safari on Mac works fine) Thanks, Terry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
On Fri, January 11, 2008 1:51 pm, Manuel Lemos wrote: Hello, on 01/11/2008 02:29 PM Richard Heyes said the following: Hi, Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? It depends on the platform you are running PHP. There is a myth by which people believe that using mail() is slower than using SMTP connections. Some of those people using PHP on Windows (especially for development). On Windows, mail() uses SMTP connections. On Linux/Unix, mail() uses sendmail or equivalent programs. These programs use pipes to communicate, which are much faster than using SMTP TCP sockets. If you have your sendmail equivalent program properly configured, no SMTP connection is used when queueing messages using the sendmail program. It may be possible to get sendmail to queue up the emails quickly, but they won't actually go out until much later, when the queue is run... And I'd be interested to hear of an actual side-by-side comparison on comparable hardware where sendmail using pipes beats SMTP on a LAN. If your SMTP server is halfway across the planet, well, yeah, then you got a problem right there... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Fri, January 11, 2008 12:22 pm, Jochem Maas wrote: Eric Butera schreef: On Jan 11, 2008 11:33 AM, Stut [EMAIL PROTECTED] wrote: No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. SMTP software can be configured that way, or not. But it SHOULD be sending proper response codes when it decides to quit on you, and your code *SHOULD* be ready to deal sensibly with those codes, and any others defined in the SMTP spec. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Fri, January 11, 2008 10:29 am, Richard Heyes wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? If mail() is faster, prepare for the second coming... :-) mail() fires up the send mail binary. For each call. SMTP opens up a socket connection and then you just keep spewing data at it and getting OK back (hopefully). You'd have to have a dog-slow SMTP box and a very souped-up sendmail box to get them on the same footing, almost for sure. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
Where should I look for further help about mod_php? How do I beg to someone add a feature in mod_php? On Jan 11, 2008 8:00 PM, Nate Tallman [EMAIL PROTECTED] wrote: To fix this scenerio, chroot would require different apache processes running under different users. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
Lucas Prado Melo wrote: Where should I look for further help about mod_php? How do I beg to someone add a feature in mod_php? On Jan 11, 2008 8:00 PM, Nate Tallman [EMAIL PROTECTED] wrote: To fix this scenerio, chroot would require different apache processes running under different users. What feature would you think about adding to it? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
On Jan 11, 2008 9:28 PM, Jim Lucas [EMAIL PROTECTED] wrote: What feature would you think about adding to it? I think we should be able to set (editing httpd.conf in apache) which folders are visible to any php script (including shell commands written in it). So, we could use Directory tags and set different rules to different sets of files. What do you think about it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is some_function()[some_index] invalid syntax?
On Friday 11 January 2008, Zoltán Németh wrote: So, make all your functions return objects, and have the object have a method called get or index or something like that that returns the index requested. :) Better yet, make everything an object: String, Numeric, Array, etc and call it Java ;) More like C#. :-) Java still has primitives. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
Hello, on 01/11/2008 08:26 PM Richard Lynch said the following: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? It depends on the platform you are running PHP. There is a myth by which people believe that using mail() is slower than using SMTP connections. Some of those people using PHP on Windows (especially for development). On Windows, mail() uses SMTP connections. On Linux/Unix, mail() uses sendmail or equivalent programs. These programs use pipes to communicate, which are much faster than using SMTP TCP sockets. If you have your sendmail equivalent program properly configured, no SMTP connection is used when queueing messages using the sendmail program. It may be possible to get sendmail to queue up the emails quickly, but they won't actually go out until much later, when the queue is run... That is exactly how it works when you send a message via sendmail SMTP server. The message is not delivered right away. If it was there is no way for the SMTP server to return so fast. If the SMTP server would wait to have the message delivered, it would take a long time. Which is exactly what happens when you call the sendmail program directly because its default delivery mode is to attempt to deliver the message right away. Anyway, that is irrelevant. What matters is that PHP is freed to send a message to the next recipient or to do other stuff. That is why configuring it to defer the delivery is a much better idea, than waiting for the message to be processed. Anyway, the actual delivery may take days to happen because often MTA needs to retry many times, especially now that many SMTP servers are using grey listing. It does not make much sense to wait for any delivery. Still, if you are concerned with waiting for the queue manage to process the messages, the delay between queue runs is configurable. If you are still not happy you can configure sendmail queue manager to keep running persistently. Still if you want the fastest delivery in the world, you can skip queueing and talk directly to the final SMTP server. That is what the direct_delivery mode of this SMTP class does. I use it for deliverying really urgent messages. It uses PHP only, there is no sendmail or any MTA in the middle. That is why it is the fastest solution. The class is the MTA itself. http://www.phpclasses.org/smtpclass Actually I use it with the wrapper of the MIME message class for SMTP because I still need to compose the messages conforming to the e-mail standards, and that is something hard to do by hand. http://www.phpclasses.org/mimemessage This class comes with mail() function replacement named urgent_mail() that uses the direct delivery mode. If the message is delivered to the final SMTP server for some reason, it drops it in the local MTA using the mail() function. For deliverying non-urgent messages, I use the default delivery method that uses the mail() function, which pipes messages to the MTA via the sendmail program or equivalent. Actually, I do not use sendmail. I use qmail which has its queue manager running all the time by default. Actually, I don't know if you can make the qmail queue manager run only once in a while like with sendmail. The class above also has a driver class to send message via sendmail. That driver provides options to tell sendmail to queue the messages, instead of waiting for the message delivery. Since I use qmail, it does not matter because it always queue the messages. And I'd be interested to hear of an actual side-by-side comparison on comparable hardware where sendmail using pipes beats SMTP on a LAN. I am not sure what you mean. You see, when a message is received by a SMTP server, it is passed also via pipes to the queue manager. The queue manager decides to send the message to the final SMTP server via the SMTP client or just drop it in a queue. So, the message goes to the same destination, except that using SMTP is the slow path, because the TCP overhead (think of DNS resolution, TCP opening sockets, waiting for connections, TCP packet information stuff, TCP error handling, TCP closing sockets, etc..). TCP connections are not a good idea for local connections. That is why under Linux/Unix there are Unix domain sockets which are basically pipes for inter-program communication. If your SMTP server is halfway across the planet, well, yeah, then you got a problem right there... What SMTP server? The final SMTP server associated to the domain of the recipient? You know you do not need a SMTP server to send messages. You just need an MTA (Mail Transfer Agent). Once you queue the message in the MTA queue, it will take care of the delivery. -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to
Re: [PHP] SMTP vs mail()
Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. Yep - exim by default has a setting of 100 emails per smtp connection. Try to send more than that and you'll get errors. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SMTP vs mail()
And I'd be interested to hear of an actual side-by-side comparison on comparable hardware where sendmail using pipes beats SMTP on a LAN. I don't have that but a comparison between the main open-source mta's (all out of the box, no optimizations for any of them) revealed sendmail sucks the most - it took almost 3x as long as postfix exim to send the same email to the same number of recipients (of course using the same script). qmail was in the middle. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP shell commands
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lucas Prado Melo Sent: Friday, January 11, 2008 8:50 PM To: Jim Lucas Cc: php-general@lists.php.net Subject: Re: [PHP] PHP shell commands On Jan 11, 2008 9:28 PM, Jim Lucas [EMAIL PROTECTED] wrote: What feature would you think about adding to it? I think we should be able to set (editing httpd.conf in apache) which folders are visible to any php script (including shell commands written in it). So, we could use Directory tags and set different rules to different sets of files. What do you think about it? I guess what you are looking for is mod_suphp. STFW or ask the list, someone will give you good hints for sure (sorry, have little time right now). Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php