php-general Digest 28 Sep 2010 08:03:43 -0000 Issue 6963
Topics (messages 308333 through 308339):
Re: Array question
308333 by: Erik L. Arneson
Re: Php Newsletter script
308334 by: [email protected]
Controlling Output Buffering via php.ini
308335 by: MikeB
308337 by: HallMarc Websites
308338 by: HallMarc Websites
Re: [PHP-DEV] Re: [PHP] mod_php
308336 by: Richard Lynch
Re: Domain Controller Discovery in PHP
308339 by: Jason
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
pgpwNm8fG8bmW.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
It's probably worth noting that very few email clients in use actually observe
xhtml. When creating html emails you have to step back a half dozen years for
outlook, which is the current dominant client because of offices.
Essentially, its back to basics, with tables for layout, font tags, and little,
if any, css. Images for layout are also hit and miss because of spam protection.
If you can't create a template yourself, you're best off looking for one online
that can be used in an email marketing system.
Thanks,
Ash
http://www.ashleysheridan.co.uk
----- Reply message -----
From: "David Mehler" <[email protected]>
Date: Mon, Sep 27, 2010 20:25
Subject: [PHP] Php Newsletter script
To: "php-general" <[email protected]>
Hello,
I'm wondering if anyone could recommend a newsletter script they use
and like? Some requirements I have are:
1. Free preferred
2. Can be used via a web browser
3. Can put the newsletter submission on a web page
4. Can use rss to feed that web page
5. Produce Xhtml compliant code and integrate well with a site's existing css
6. can optionally send that newsletter out as plain text or html
Googling has not helped in this matter.
Thanks.
Dave.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I want to turn off output buffering.
In the php.ini section I found this and changed it as follows:
; Note: Output buffering can also be controlled via Output Buffering Control
; functions.
; Possible Values:
; On = Enabled and buffer is unlimited. (Use with caution)
; Off = Disabled
; Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
; Changed by MikeB 09/27/2010
;output_buffering = 4096
output_buffering = Off
Previously when I did a phpinfo(), I got the value of 4096.
After my change, I get:
output_buffering no value
Some other phpinfo() values (eg. Register Globals) display an "Off" value.
Did I make the change correctly or is the syntax different?
I did go to the url referenced above, but nowhere that I searched could
I find the way to specify the value in the php.ini file.
Thanks.
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: MikeB [mailto:[email protected]]
Sent: Monday, September 27, 2010 9:01 PM
To: [email protected]
Subject: [PHP] Controlling Output Buffering via php.ini
I want to turn off output buffering.
In the php.ini section I found this and changed it as follows:
; Note: Output buffering can also be controlled via Output Buffering Control
; functions.
; Possible Values:
; On = Enabled and buffer is unlimited. (Use with caution)
; Off = Disabled
; Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
; Changed by MikeB 09/27/2010
;output_buffering = 4096
output_buffering = Off
Previously when I did a phpinfo(), I got the value of 4096.
After my change, I get:
output_buffering no value
Some other phpinfo() values (eg. Register Globals) display an "Off" value.
Did I make the change correctly or is the syntax different?
I did go to the url referenced above, but nowhere that I searched could
I find the way to specify the value in the php.ini file.
Thanks.
Your output statement is commented out
__________ Information from ESET Smart Security, version of virus signature
database 5484 (20100927) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: MikeB [mailto:[email protected]]
Sent: Monday, September 27, 2010 9:01 PM
To: [email protected]
Subject: [PHP] Controlling Output Buffering via php.ini
I want to turn off output buffering.
In the php.ini section I found this and changed it as follows:
; Note: Output buffering can also be controlled via Output Buffering Control
; functions.
; Possible Values:
; On = Enabled and buffer is unlimited. (Use with caution)
; Off = Disabled
; Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
; Changed by MikeB 09/27/2010
;output_buffering = 4096
output_buffering = Off
Previously when I did a phpinfo(), I got the value of 4096.
After my change, I get:
output_buffering no value
Some other phpinfo() values (eg. Register Globals) display an "Off" value.
Did I make the change correctly or is the syntax different?
I did go to the url referenced above, but nowhere that I searched could
I find the way to specify the value in the php.ini file.
Thanks.
Bah sorry misread your question
__________ Information from ESET Smart Security, version of virus signature
database 5484 (20100927) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
On Fri, August 20, 2010 1:15 pm, StanisÅaw Findeisen wrote:
> On 2010-08-20 17:10, Bostjan Skufca wrote:
> 1. What optimizations does PHP interpreter make? I guess it should be
> able to check file modification time and cease to compile it again and
> again. Is this correct?
PHP does not do that.
There are opcode caches such as APC which do.
And APC is rumored to be rolled into the next release, or perhaps is
available in 5.3 already.
> There is some bytecode form, right?
Yes, PHP compiles to bytecode.
> What else does it do? For instance if there is a big, immutable class
> in
> the application (say it contains a bunch of constant XML documents,
> hardcoded into the source): will the interpreter notice that and
> instantiate this class only once across multiple requests?
No.
PHP is a "shared nothing" architecture, by design.
Scaling is accomplished by simply tossing more boxes in, with no
worries about shared resources being out of sync.
> What if this class generates side effects (like printing "hello world"
> in the constructor) and what if it doesn't?
PHP has nothing so formal about "side effects" or the lack thereof.
That's up to the application developer to worry about.
> 2. I guess PHP application wide cache is quite a different story? For
> the worker processes are separate... Or maybe PHP interpreter itself
> provides any means for that??
Again, it's a Shared Nothing architecture by design.
It's not Java.
It's not even ASP.
It's PHP, and we *like* it that way. KISS
> 3. Does PHP interpreter maintain any state across different requests
> within the context of a single Apache worker process? If so, what does
> this state contain?
PHP does not maintain state, as HTTP is a stateless protocol.
Technically, this is not 100% true, as I'm sure there is *something*
down in the guts of the C code that has some kind of "state" but it's
sure not available in userland PHP code.
> 4. Does PHP interpreter maintain any global state within the context
> of
> a single Apache HTTP server instance? If so, what does this state
> contain?
No.
> 5. What about system wide PHP interpreter state?...
No.
> 6. I heard some nasty rumors that PHP interpreter resource management
> is
> somewhat problematic (memory leaks, or something), and because of that
> those Apache worker processes have to be killed from time to time.
>
> Could you please comment on this?
It is trivial to create long-running scripts that "leak" memory by not
clearing variables.
PHP's garbage collector is simplistic, even rudimentary in nature.
But most PHP scripts are designed to spit out a web page in microseconds.
At the end of the script, everything is released.
So, it *CAN* be problematic if:
A) you're using PHP for long-running scripts and
B) you don't have enough sense to wipe out variables that will keep
tons of RAM in use.
--
brain cancer update:
http://richardlynch.blogspot.com/search/label/brain%20tumor
Donate:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: Robert Cummings [mailto:[email protected]]
Sent: 27 September 2010 19:38
To: Jason
Cc: 'PHP General'
Subject: Re: [PHP] Domain Controller Discovery in PHP
On 10-09-27 11:26 AM, Jason wrote:
> Hi Rob,
>
> I believe you should be able to do this with nothing more than DNS (this is
> how Windows clients do it).
>
> Once you have the DNS domain of the machine you're on
> (_SERVER["USERDNSDOMAIN"]), query for SRV records called the following:
>
> Name: _ldap._tcp.dc._msdcs.<machine domain name>
>
> That should return one or more records in the answer, each one will be the
> FQDN of a domain controller.
>
> Additional info from the horses mouth: http://support.microsoft.com/kb/247811
Hi Jason,
Thanks for the info. I don't actually have that server field (maybe
because the article is for windows 2000), but maybe I can use your info
to get to the next step anyways.
Cheers,
Rob.
--
Hi Rob,
I've checked a couple of windows machines (which I admit I had assumed you were
running php on) and the ENV variable "USERDNSDOMAIN" is definitely what you
need. If your php is running on linux, you'll need to find out the target
windows domain some other way (user input/config file maybe?).
The article is a Win2k based one - there is a link to the XP one in the
top-right corner. However I read both and things haven't changed from a DNS
point of view.
Here's a code snippet for you (run on my network from a windows workstation)...
<?php
# assume $_SERVER["USERDNSDOMAIN"] is equal to "xxx.local".
print_r(
dns_get_record("_ldap._tcp.dc._msdcs.".$_SERVER["USERDNSDOMAIN"],DNS_SRV) );
?>
And the output (edited for obvious reasons):
Array
(
[0] => Array
(
[host] => _ldap._tcp.dc._msdcs.xxx.local
[type] => SRV
[pri] => 0
[weight] => 100
[port] => 389
[target] => dc2.xxx.local
[class] => IN
[ttl] => 545
)
[1] => Array
(
[host] => _ldap._tcp.dc._msdcs.xxx.local
[type] => SRV
[pri] => 0
[weight] => 100
[port] => 389
[target] => dc1.xxx.local
[class] => IN
[ttl] => 545
)
)
HTH
J
--- End Message ---