php-general Digest 12 Nov 2007 02:46:22 -0000 Issue 5123
Topics (messages 264318 through 264336):
Re: chrooted php5-cgi in a non chrooted apache
264318 by: Joerg Schoppet
functions versus includes
264319 by: Frank Lopes
264331 by: Frank Lopes
264332 by: Nathan Nobbe
264333 by: Chris
264334 by: Bastien Koert
264335 by: Robert Cummings
PHP editor
264320 by: Frank Lopes
264321 by: Jay Blanchard
264322 by: Per Jessen
264323 by: Daniel Brown
264324 by: elk dolk
264326 by: Jochem Maas
264327 by: Børge Holen
264328 by: Brendon Van Heyzen
264329 by: Jochem Maas
264330 by: Børge Holen
Re: Help securing a server : Owned by W4n73d H4ck3r
264325 by: Dimiter Ivanov
Need a hint how to track an error
264336 by: Ronald Wiplinger
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 ---
Hi Jochem,
yes, you are right. But as you wrote, it is only a work around and won't
give me the security I want to have.
Joerg
Jochem Maas wrote:
> hi Joerg,
>
> not a solution but the open_basedir ini setting on a per Vhost
> setting may offer a [partial] work around
>
--- End Message ---
--- Begin Message ---
I just started using PHP and got to think...
Without getting into the discussion of "best practices", strictly from a
performance perspective,
what is faster: a function or an include?
For example I have a block of text that needs to appear mutliple times
throughout the site.
Will I be better off creating a function with its contents and then later
just calling the function or,
will it be faster (from an execution perspective) for me to create an .inc
file that gets included later on?
Thanks for the your thoughts.
--- End Message ---
--- Begin Message ---
No takers on this topic?
""Frank Lopes"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I just started using PHP and got to think...
Without getting into the discussion of "best practices", strictly from a
performance perspective,
what is faster: a function or an include?
For example I have a block of text that needs to appear mutliple times
throughout the site.
Will I be better off creating a function with its contents and then later
just calling the function or,
will it be faster (from an execution perspective) for me to create an .inc
file that gets included later on?
Thanks for the your thoughts.
--- End Message ---
--- Begin Message ---
On Nov 11, 2007 6:02 PM, Frank Lopes <[EMAIL PROTECTED]> wrote:
> No takers on this topic?
>
>
> ""Frank Lopes"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >I just started using PHP and got to think...
> >
> > Without getting into the discussion of "best practices", strictly from
> a
> > performance perspective,
> > what is faster: a function or an include?
> >
> > For example I have a block of text that needs to appear mutliple times
> > throughout the site.
> >
> > Will I be better off creating a function with its contents and then
> later
> > just calling the function or,
> > will it be faster (from an execution perspective) for me to create an
> .inc
> > file that gets included later on?
> >
> > Thanks for the your thoughts.
>
what do you imagine the code might look like in the .inc file?
if you create a variable in global scope in your first script say
$a = 5;
then in another file you intend to include you modify it, again in global
scope,
if($a > 5) {
$a = 10;
} else {
$a = 0;
}
well i think that is really messy.
getting to the function idea.. were you planning to put the function in the
same file and thats why you view it as an alternative to including a file?
i would at least create a function and put it in the file you intend to
include.
i imagine it will be a hair slower, but it will be much more organized.
-nathan
--- End Message ---
--- Begin Message ---
Frank Lopes wrote:
I just started using PHP and got to think...
Without getting into the discussion of "best practices", strictly from
a performance perspective,
what is faster: a function or an include?
For example I have a block of text that needs to appear mutliple times
throughout the site.
Will I be better off creating a function with its contents and then
later just calling the function or,
will it be faster (from an execution perspective) for me to create an
.inc file that gets included later on?
Micro-optimization is pretty useless. I seriously doubt you would notice
any difference in performance.
This comes under the other discussions like about which is faster - a
foreach/while/for loop.
You'll find other bottlenecks (eg changing a regex to do an str_replace)
which will make a bigger difference.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Wouldn't it be simpler to add some timers in and check for yourself?
Bastien
----------------------------------------> To: [EMAIL PROTECTED]> From: [EMAIL
PROTECTED]> Date: Sun, 11 Nov 2007 18:02:58 -0500> Subject: [PHP] Re: functions
versus includes>> No takers on this topic?>>> ""Frank Lopes"" wrote in
message> news:[EMAIL PROTECTED]>>I just started using PHP and got to
think...>>>> Without getting into the discussion of "best practices", strictly
from a>> performance perspective,>> what is faster: a function or an
include?>>>> For example I have a block of text that needs to appear mutliple
times>> throughout the site.>>>> Will I be better off creating a function with
its contents and then later>> just calling the function or,>> will it be faster
(from an execution perspective) for me to create an .inc>> file that gets
included later on?>>>> Thanks for the your thoughts.>> --> PHP General Mailing
List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
_________________________________________________________________
Have fun while connecting on Messenger! Click here to learn more.
http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
--- End Message ---
--- Begin Message ---
On Mon, 2007-11-12 at 11:27 +1100, Chris wrote:
> Frank Lopes wrote:
> > I just started using PHP and got to think...
> >
> > Without getting into the discussion of "best practices", strictly from
> > a performance perspective,
> > what is faster: a function or an include?
> >
> > For example I have a block of text that needs to appear mutliple times
> > throughout the site.
> >
> > Will I be better off creating a function with its contents and then
> > later just calling the function or,
> > will it be faster (from an execution perspective) for me to create an
> > .inc file that gets included later on?
>
> Micro-optimization is pretty useless. I seriously doubt you would notice
> any difference in performance.
>
> This comes under the other discussions like about which is faster - a
> foreach/while/for loop.
>
> You'll find other bottlenecks (eg changing a regex to do an str_replace)
> which will make a bigger difference.
Actually, if you're going to use a comparison between using regex and
string replacement as an example of lower hanging optimization fruit, I
think you'll find the difference between invoking a function and
including a file to be on par. The function is by far the better
solution when considering speed.
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
Being very new to PHP (empahsis on VERY...), I wonder what most of you use
to develop in PHP?
I have experimented with DreamWeaver, UltraEdit, phoDesigner, Eclipse etc.
What would you recommend that I use?
--- End Message ---
--- Begin Message ---
[snip]
Being very new to PHP (empahsis on VERY...), I wonder what most of you
use
to develop in PHP?
[/snip]
Search the archives, there was a discussion on IDE's just last week.
--- End Message ---
--- Begin Message ---
Frank Lopes wrote:
> Being very new to PHP (empahsis on VERY...), I wonder what most of you
> use to develop in PHP?
Personally I use vi or kate.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
On Nov 11, 2007 11:23 AM, Per Jessen <[EMAIL PROTECTED]> wrote:
> Frank Lopes wrote:
>
> > Being very new to PHP (empahsis on VERY...), I wonder what most of you
> > use to develop in PHP?
>
> Personally I use vi or kate.
Specifically, ViM (Vi iMproved) for me. It's rare that I do much
with the OS GUI.... I'm much more comfortable in a command-line
environment.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.
--- End Message ---
--- Begin Message ---
Frank Lopes wrote:
> Being very new to PHP (empahsis on VERY...), I wonder what most of you
> use to develop in PHP?
Personally I use vi or kate.
--------------------------------------------------------
An editor that can give you WYSIWYG and color print outs.
Has anybody any idea?
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Jay Blanchard wrote:
> [snip]
> Being very new to PHP (empahsis on VERY...), I wonder what most of you
> use
> to develop in PHP?
> [/snip]
>
> Search the archives, there was a discussion on IDE's just last week.
and pretty much every week before that :-)
when beginning your most valuable tool is not the IDE but ... http://php.net/
as in http://php.net/<search-param|function-name|extension-name|etc>
and when your really stuck, a well thought out question to this list
will usually result in "something helpful"[tm].
>
--- End Message ---
--- Begin Message ---
On Sunday 11 November 2007 20:36:39 Jochem Maas wrote:
> Jay Blanchard wrote:
> > [snip]
> > Being very new to PHP (empahsis on VERY...), I wonder what most of you
> > use
> > to develop in PHP?
> > [/snip]
> >
> > Search the archives, there was a discussion on IDE's just last week.
>
> and pretty much every week before that :-)
>
> when beginning your most valuable tool is not the IDE but ...
> http://php.net/ as in
> http://php.net/<search-param|function-name|extension-name|etc>
>
> and when your really stuck, a well thought out question to this list
> will usually result in "something helpful"[tm].
WHAT... whenever did that happen?!!?
--
---
Børge Holen
http://www.arivene.net
--- End Message ---
--- Begin Message ---
Combo of Zend neon and vim (macvim).
--Brendon
On Nov 11, 2007, at 10:35 AM, Frank Lopes wrote:
Being very new to PHP (empahsis on VERY...), I wonder what most of
you use to develop in PHP?
I have experimented with DreamWeaver, UltraEdit, phoDesigner,
Eclipse etc.
What would you recommend that I use?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Børge Holen wrote:
> On Sunday 11 November 2007 20:36:39 Jochem Maas wrote:
>> Jay Blanchard wrote:
>>> [snip]
>>> Being very new to PHP (empahsis on VERY...), I wonder what most of you
>>> use
>>> to develop in PHP?
>>> [/snip]
>>>
>>> Search the archives, there was a discussion on IDE's just last week.
>> and pretty much every week before that :-)
>>
>> when beginning your most valuable tool is not the IDE but ...
>> http://php.net/ as in
>> http://php.net/<search-param|function-name|extension-name|etc>
>>
>> and when your really stuck, a well thought out question to this list
>> will usually result in "something helpful"[tm].
>
> WHAT... whenever did that happen?!!?
no sure about the well thought out question.
with regard to "something helpful" you have to remember it's something
akin to microsoft's "innovative software and fair market practices"
>
>
>
--- End Message ---
--- Begin Message ---
On Sunday 11 November 2007 22:31:29 Jochem Maas wrote:
> Børge Holen wrote:
> > On Sunday 11 November 2007 20:36:39 Jochem Maas wrote:
> >> Jay Blanchard wrote:
> >>> [snip]
> >>> Being very new to PHP (empahsis on VERY...), I wonder what most of you
> >>> use
> >>> to develop in PHP?
> >>> [/snip]
> >>>
> >>> Search the archives, there was a discussion on IDE's just last week.
> >>
> >> and pretty much every week before that :-)
> >>
> >> when beginning your most valuable tool is not the IDE but ...
> >> http://php.net/ as in
> >> http://php.net/<search-param|function-name|extension-name|etc>
> >>
> >> and when your really stuck, a well thought out question to this list
> >> will usually result in "something helpful"[tm].
> >
> > WHAT... whenever did that happen?!!?
>
> no sure about the well thought out question.
> with regard to "something helpful" you have to remember it's something
> akin to microsoft's "innovative software and fair market practices"
oh... well that makes it ok =D
--
---
Børge Holen
http://www.arivene.net
--- End Message ---
--- Begin Message ---
On Nov 9, 2007 5:48 PM, robert mena <[EMAIL PROTECTED]> wrote:
> Hi Daniel,
>
> According to the audit this happened yesterday.
>
> I am searching astalavista but could not find anything, probably
> because I am being too specific.
>
> From the php side (or closely) what steps would you recommend in order
> to have a better security?
>
> I could not find a consistent 'list' of configuration settings to
> disable or change besides the register_globals.
>
> From the system side my list so far includes (some already in place previous)
> - no devel tools installed on the server (gcc etc)
> - /tmp mounted with no_exec
> - chroot apache
> - use mod_security
>
> Thanks.
>
>
> > >
> >
> > It's all good. We go off on tangents enough here anyway, so I
> > suppose one more wouldn't hurt. ;-P
> >
> > The person doing this seems to be relatively new to the scene,
> > only defacing websites with common vulnerabilities that you can find
> > anywhere on the Internet (http://astalavista.box.sk/ for example).
> > Check out Zone-H (http://www.zone-h.net/) to see if your domains are
> > on there, and to see if you can build a pattern from his/her past
> > exploits. That should help you in determining how he/she is doing it.
> >
> > You're on the right track in guessing that it was CMS-related.
> > Remember how many sites and servers were compromised when phpBB
> > exploits were announced and left unpatched? These jackass skript
> > kiddies just Google for known versions and deface whatever they can.
> > It's not like the old days where you picked a target and found a way
> > in.... now it's just that you pick your way in and find a target.
> >
> > *yawn!* No challenge anymore.... these kids are too lazy....
> >
> >
> > --
> >
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
> >
> > If at first you don't succeed, stick to what you know best so that you
> > can make enough money to pay someone else to do it for you.
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
You may try the suhosin patch:
http://www.hardened-php.net/suhosin/
I'm using FreeBSD and the current versions of php comes with it
selected by default (probably for a good reason)
--- End Message ---
--- Begin Message ---
My php program is working with Firefox, but not with Internet Explorer.
I cannot see anything I did wrong, like forgotten " or > where Firefox
is more forgiving than IE.
I used the error console from Firefox combined with a lynx output to see
what line it is.
The error output in IE is:
Line: 2
Char: 104
Error: Object doesn't support this property or method
Code: 0
URL: http://xxx.xxx.xx/mypage.php
In Firefox:
Line 225
Field has no properties
http://xxx.xxx.xx/mypage.php
Not even the same line!!! Line 114 ~ 250 is a long comment!
Is there a tool to find the problem?
bye
Ronald
--- End Message ---