Re: [PHP] Re: SEO Experts?

2010-09-27 Thread john

> On 9/26/2010 8:09 AM, David Mehler wrote:
>> Hello,
>> Do we have any SEO experts on this list? I'm not one, learning only,
>> reading a book and a few articles/tutorials from webmasters, and I'm
>> wanting to optimize an existing site to get the best search rank
>> possible. Some techniques, dos and don'ts would be appreciated.
>> Thanks.
>> Dave.

Sure, it's what I do.

Well first you need to work out which keyphrases to optimise for, and
that's not obvious. Search Google for "keyword tool external" to find a
Google tool that tells you something about the demand for a phrase and the
competition for it.

What you are trying to find are phrases that a) are very very relevant to
your client, b) have lots of demand traffic, and c) don't have too much
competition.

The other thing to check is whether anyone else is making money at your
selected phrases, so search for them in Google and see if people are
advertising.

Then group your phrases: so "wet dog" becomes a keyphrase group that
includes phrases like "getting rid of wet dog smell", "avoiding wet dog
shake" and so on.

You are building a site to satisfy the keyphrase groups you've identified,
so then one way or another you want a "wet dog" page that's optimised for
that phrase, which means you mention "wet dog" a few times especially in
the headline and page title and don't mention lots of other things.

Then you want some links from other people's pages, Twitter, Delicious,
YouTube and so on to your wet dog page, preferably text links that include
the phrase "wet dog".

Then you watch your Analytics data to check that people who arrive on your
site are satisfied and covert into sales (or signups or whatever you are
doing). If not, you run a Google Website Optimizer test to improve things
like your headline, photos and so on.

If you like, run through http://www.flowmarketing.co.uk and fill in the
form where you get stuck. It's obviously a work in progress :-) and I'll
complete the page that you end up at.

By all means email me the website and I can be more specific.

Good luck :-)

Cheers
J
http://www.johnallsopp.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP DNS resolving in chroot-ed environment

2010-09-27 Thread Georgi Hristozov
Hello,

I'm running a Gentoo-hardened box with PHP 5.2.14-pl0-gentoo (Suhosin
included) and Apache 2.2.16. mod_php is running in a chroot, using
mpm_peruser. Everything works OK, except the PHP DNS resolving, which I
need to access HTTP resources. It fails with both the curl and http
extensions.

With some stracing of the Apache child processes I found that PHP is
trying to access the following files: hosts, nsswitch.conf, resolv.conf
and the libnss libraries. I've copied them to the chroot, but the
resolving still fails. strace showed failed accesses to /dev/urandom
and /dev/log, but mounting /dev in the chroot didn't help.

My php.ini can be found at [1]. I'm setting the following additional
flags in the vhost configuration:
engine on
open_basedir "/htdocs:/sessions:/tmp"
session.save_path "/sessions"
upload_tmp_dir "/tmp"

Does anybody run similar chroot-ed PHP? Any help will be appreciated!
Thanks in advance!

[1] http://forkbomb.nl/temp/php.ini


signature.asc
Description: PGP signature


Re: [PHP] PHP DNS resolving in chroot-ed environment

2010-09-27 Thread Per Jessen
Georgi Hristozov wrote:

> Hello,
> 
> I'm running a Gentoo-hardened box with PHP 5.2.14-pl0-gentoo (Suhosin
> included) and Apache 2.2.16. mod_php is running in a chroot, using
> mpm_peruser. Everything works OK, except the PHP DNS resolving, which
> I need to access HTTP resources. It fails with both the curl and http
> extensions.
> 
> With some stracing of the Apache child processes I found that PHP is
> trying to access the following files: hosts, nsswitch.conf,
> resolv.conf and the libnss libraries. 

Just being pedantic: not actually PHP, but the resolver. 

> I've copied them to the chroot, but the resolving still fails. strace
> showed failed accesses to /dev/urandom and /dev/log, but mounting /dev
> in the chroot didn't help.

What does your strace show when you have mounted /dev in your chroot
(with -o bind) ?



-- 
Per Jessen, Zürich (10.1°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] if/elseif being treated as if/if

2010-09-27 Thread Ford, Mike
> -Original Message-
> From: tedd [mailto:tedd.sperl...@gmail.com]
> Sent: 25 September 2010 16:02

 
> One can make the argument that the ELSE IF statement first surfaced
> circa 1977 in FORTRAN 77 and the CASE statement came later in
> FORTRAN
> 90 circa 1991.

Being a fully-fledged member of the pedants' society, I can't let that go 
without comment.

Those dates only hold if you stick to FORTRAN. Algol-68 had if-elif-else-fi, 
and I don't believe it was a pioneer in the structure even then (although the 
syntax may have been novel). It also had a case-esac structure. I'd say both 
elseif and case/switch developed in other languages and were adopted into 
FORTRAN long after they were established as bona fide programming constructs.

Cheers!

Mike

 -- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, C507 City Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: m.f...@leedsmet.ac.uk 
Tel: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Heredocs, print_r() and newline "\n" and fnmatch() -curious failures ...

2010-09-27 Thread YAD(YetAnotherDavid)

Peter Lind wrote:

On 23 September 2010 21:47, YAD(YetAnotherDavid)  wrote:

This code is 95% cut and paste from the PHP manual examples -
the Types/Strings/Heredocs section and the Filesystem/fnmatch pages.
There are actually two questions here - I have combined the code into one

 ...


Question 1 : how to get the newline functioning ? even print_r() output
is not 'newlined' as it should be. Also note the \n is missing between the "
" in the output text of the second test!



Are you outputting to browser or to command line? Browsers have a
habit of ignoring whitespaces, reducing them to one whitespace
character regardless of their type or how many.

Regards
Peter



Thanks Peter, - output is to browser, I develop in Notepad++ and 
Firefox, and confirm in IE8. But this stuff used to work - I have been 
working with PHP for about two years (not pro) and am used to formatting 
my output for legibility - especially echoing or var_dumping variables 
when still testing the code. So the failure is recent and I just can't 
figure what changed.

David

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Heredocs, print_r() and newline "\n" and fnmatch() -curious failures ...

2010-09-27 Thread Peter Lind
On 24 September 2010 12:49, YAD(YetAnotherDavid)  wrote:
> Peter Lind wrote:
>>
>> On 23 September 2010 21:47, YAD(YetAnotherDavid)  wrote:
>>>
>>> This code is 95% cut and paste from the PHP manual examples -
>>> the Types/Strings/Heredocs section and the Filesystem/fnmatch pages.
>>> There are actually two questions here - I have combined the code into one
>
>  ...
>
>>> Question 1 : how to get the newline functioning ? even print_r()
>>> output
>>> is not 'newlined' as it should be. Also note the \n is missing between
>>> the "
>>> " in the output text of the second test!
>>>
>>
>> Are you outputting to browser or to command line? Browsers have a
>> habit of ignoring whitespaces, reducing them to one whitespace
>> character regardless of their type or how many.
>>
>> Regards
>> Peter
>>
>
> Thanks Peter, - output is to browser, I develop in Notepad++ and Firefox,
> and confirm in IE8. But this stuff used to work - I have been working with
> PHP for about two years (not pro) and am used to formatting my output for
> legibility - especially echoing or var_dumping variables when still testing
> the code. So the failure is recent and I just can't figure what changed.
> David

Browsers treat newlines as any other whitespace - so print_r and
var_dump will not, on their own, provide you with a linebreak in a
browser. If you've got xdebug installed, var_dump will provide a nicer
output (including line-breaks).
However, by far the easiest way to check if you're actually getting
linebreaks in your output is checking the source.

If you're suddenly experiencing a change in output, then some of your
environment variables have changed - hard to say which one without
knowing more about your system, but you must obviously have
changed/updated something for this to happen.

Regards
Peter

-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] if/elseif being treated as if/if

2010-09-27 Thread tedd

At 11:48 AM +0100 9/27/10, Ford, Mike wrote:

 > -Original Message-

 From: tedd [mailto:tedd.sperl...@gmail.com]
 Sent: 25 September 2010 16:02




 One can make the argument that the ELSE IF statement first surfaced
 circa 1977 in FORTRAN 77 and the CASE statement came later in
 FORTRAN
 90 circa 1991.


Being a fully-fledged member of the pedants' society, I can't let 
that go without comment.


Those dates only hold if you stick to FORTRAN. Algol-68 had 
if-elif-else-fi, and I don't believe it was a pioneer in the 
structure even then (although the syntax may have been novel). It 
also had a case-esac structure. I'd say both elseif and case/switch 
developed in other languages and were adopted into FORTRAN long 
after they were established as bona fide programming constructs.


Cheers!

Mike


Mike:

And I can't let your statement go without saying that my statement 
was taken out of context. For example, following the quote you 
provided was:


"But I know I was using computed GOTOs and GOSUBs long before then."

Which puts forth a situation that you actually support in your 
rebuttal. In short, you are supporting my argument.


Additionally, I said that "One can make the argument...", which was 
not the argument that I was making (nor you). If you disagree with 
what I am disagreeing, then we are in agreement.


So, we are in agreement that constructs found in other languages 
preceded those finally adopted into FORTRAN.


The main point of my post (not supported by anything other than my 
logic) was that the CASE construct was more likely derived from the 
computed GOTO rather than from the ELSEIF construct.


Do you agree with that?

Cheers,

tedd

--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Domain Controller Discovery in PHP

2010-09-27 Thread Robert Cummings

Hello list,

Does anyone know a method in Windows Server 2003 to discover one or more 
domain controllers to which the machine is connected. I know as an 
administrator I can use dsquery and various other administrator 
commands, but I'm unsure how to do so within PHP from an unprivileged 
vantage point.


Thanks,
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] Domain Controller Discovery in PHP

2010-09-27 Thread Jason
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.
 
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

HTH
Jason

-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com] 
Sent: 27 September 2010 16:05
To: PHP General
Subject: [PHP] Domain Controller Discovery in PHP

Hello list,

Does anyone know a method in Windows Server 2003 to discover one or more 
domain controllers to which the machine is connected. I know as an 
administrator I can use dsquery and various other administrator 
commands, but I'm unsure how to do so within PHP from an unprivileged 
vantage point.

Thanks,
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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Domain Controller Discovery in PHP

2010-09-27 Thread Robert Cummings

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.

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.
--
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



[PHP] Php Newsletter script

2010-09-27 Thread David Mehler
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



[PHP] Re: Array question

2010-09-27 Thread Erik L. Arneson


pgpSkuPbKbfsy.pgp
Description: PGP signature


Re: [PHP] Php Newsletter script

2010-09-27 Thread a...@ashleysheridan.co.uk
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" 
Date: Mon, Sep 27, 2010 20:25
Subject: [PHP] Php Newsletter script
To: "php-general" 

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



[PHP] Controlling Output Buffering via php.ini

2010-09-27 Thread MikeB

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_bufferingno 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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: [PHP-DEV] Re: [PHP] mod_php

2010-09-27 Thread Richard Lynch
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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Controlling Output Buffering via php.ini

2010-09-27 Thread HallMarc Websites


-Original Message-
From: MikeB [mailto:mpbr...@gmail.com] 
Sent: Monday, September 27, 2010 9:01 PM
To: php-general@lists.php.net
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_bufferingno 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
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Controlling Output Buffering via php.ini

2010-09-27 Thread HallMarc Websites


-Original Message-
From: MikeB [mailto:mpbr...@gmail.com] 
Sent: Monday, September 27, 2010 9:01 PM
To: php-general@lists.php.net
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_bufferingno 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
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php