php-general Digest 18 Jul 2009 11:14:49 -0000 Issue 6236
Topics (messages 295537 through 295540):
Re: DHCP web interface. New version.
295537 by: Daevid Vincent
Re: Internal PHP caching methodology
295538 by: Daniel Kolbo
295540 by: Daniel Kolbo
PHP 5.3 date.timezone
295539 by: John Corry
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 ---
Once again I've updated this web tool.
The big difference is that now you don't need to be running DHCP on your Web
server. It works 'stand alone'. Perfect for those using a router box (as
most are I'm sure).
A while ago I switched from having my Gentoo box be my firewall, router,
wifi, dhcp, mail, web, svn, etc... (basically everything) to an Ubuntu box
that does web/mail/etc. and a DIR-655 router which does firewall and wifi
too. This broke the script.
http://daevid.com/examples/dhcp/
The next version when I get around to it, will be even more clean as right
now it uses 'arp' and 'nmap' to get the results. Turns out, I don't really
need 'arp' (which is also not reliable) and nmap (has XML output too) will
be perfect. Not sure when that will be, but I've got myself a Trac ticket to
rewrite this.
> -----Original Message-----
> From: Daevid Vincent [mailto:[email protected]]
> Sent: Tuesday, December 02, 2003 11:06 PM
> To: [email protected]
> Cc: 'MKlinke'
> Subject: RE: [PHP] DHCP web interface. New version.
>
> Once again, I have a new version of my DHCP web page. The
> major fix in this
> one is that it does an "nmap -v -p 80 192.168.1.0/24" (thanks
> to Mike Klinke
> for the idea) to re-populate the "arp -n". The old version of
> my program
> would not always show ALL devices on the network. Some would
> also show up as
> "incomplete". I have removed all incomplete ones for this
> version, but you
> could simply comment out the line to put them back if you
> want them. You can
> specify the server's IP manually (as in the case of dual NIC
> cards), or let
> the script figure it out for you.
>
> http://daevid.com/examples/dhcp/
>
> Daevid.
>
>
> > -----Original Message-----
> > From: Daevid Vincent [mailto:[email protected]]
> > Sent: Monday, July 28, 2003 9:41 PM
> > To: [email protected]
> > Subject: [PHP] DHCP web interface. New version.
> >
> > Heya. I've just put up a new version of the DHCP web front
> > end if anyone is
> > using it or has a need for this type of thing.
> >
> > Major feature of this version:
> >
> > * a bug where if the arp table showed an "(incomplete)", I
> > ignored the entry
> > since the MAC is the hash key, many machines wouldn't show
> > up as they kept
> > over writing each other (of course, they were bunk anyways)
> > * ping & nmap tests (if ping fails, nmap is used as a backup)
> > this is useful for firewalls that may block ICMP
> > * tests can be disabled for radically faster page rendering
> > (off by default)
> > * 10 minute refresh by default rather than 10 second.
> > * SORTING! by IP now, rather than arp entries
> > * many more icons (tivo, zaurus, replay, linux, notebook,
> > servers, DAR, etc)
> > * complete/incomplete tally
> > * Name in config file is only used if dhcp doesn't show a
> name already
> >
> > This is also IMHO an excellent way for a beginer or advanced
> > coder alike to
> > see some very useful OOP/PHP coding as I use arrays of
> > objects, sorting by
> > variables IN the object (custom sort algorithm with key
> > integrity), hashing,
> > system calls, regex parsing, DHTML, etc.
> >
> > If anyone knows how to force the arp table to be current,
> > that would help.
> > Sometimes a machine is on the network, and I *know* for a
> > fact it is, but it
> > doesn't show up in "arp -n" *grumble*.
> >
> > Follow the link below.
> > http://daevid.com/examples/dhcp/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Eric Butera wrote:
> On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbo<[email protected]> wrote:
>> Hello,
>>
>> Call me a dreamer...but I got to ask.
>>
>> Is there any software for helping speed up PHP by utilizing internal PHP
>> caching?
>>
>> I am not talking about the external php cache/header control. Smarty
>> caching doesn't give me the control I need either.
>>
>> I would like to cache to a finer level than page by page, but rather on
>> a module by module basis. Each of my pages contains a subset of
>> modules. The content of these modules changes based upon certain
>> criteria (link, time, session data, but is sometimes static across the
>> site). I would like to be able to cache individual "modules"
>> (preferably based upon frequency and time to generate).
>>
>> I am trying to develop a way to do this, but I have to think a brighter
>> mind has come before me and hopefully arrived at a solution.
>>
>> As always any help/thoughts are much appreciated, except for that one
>> guy's comments (you all know who I am talking) ~ jk ;)
>>
>> Thanks,
>> `
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> Have you actually profiled your code to see where the pain points are
> vs saying 'module?' Are you also running an opcode cache? From there
> you can use data, block, or full page caching. Finally you can figure
> out if you want to store it in flat files or memory. I'd start by
> knowing what is actually the slow part using Xdebug and nail a few
> down.
>
> There is no end all solution. Some pages really don't have a lot
> going on and are hardly updated so full page is fine. Others might
> have something that is hard to generate on a sidebar, so block caching
> would be more suitable for that. As previously mentioned, Zend_Cache
> is up to the task. There is also a PEAR package called Cache_Lite
> which would work to if you're interested in file based caching.
>
So dreams do come true...
Thank you for the wonderful insight. I've been reading about the
memcached and Xdebug and Zend_Cache. I've got lots to learn, but it is
exactly the type of material i was trying to find.
I am not currently running an opcode cache. I may be doing "premature
optimization", but i want to design the entire system intelligently from
the get go rather than having to rebuild later. you know 'work smarter
not harder'....
Is it possible to run xdebug on a virtual host server on which i do not
have shell access? I can modify php.ini via cgi, but I don't know if
i'd be able to view the results of xdebug on the machine. Your opinion
would be appreciated.
Thanks so much, i feel like i've just been shown a whole new world.
dK
`
--- End Message ---
--- Begin Message ---
Daniel Kolbo wrote:
> Eric Butera wrote:
>> On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbo<[email protected]> wrote:
>>> Hello,
>>>
>>> Call me a dreamer...but I got to ask.
>>>
>>> Is there any software for helping speed up PHP by utilizing internal PHP
>>> caching?
>>>
>>> I am not talking about the external php cache/header control. Smarty
>>> caching doesn't give me the control I need either.
>>>
>>> I would like to cache to a finer level than page by page, but rather on
>>> a module by module basis. Each of my pages contains a subset of
>>> modules. The content of these modules changes based upon certain
>>> criteria (link, time, session data, but is sometimes static across the
>>> site). I would like to be able to cache individual "modules"
>>> (preferably based upon frequency and time to generate).
>>>
>>> I am trying to develop a way to do this, but I have to think a brighter
>>> mind has come before me and hopefully arrived at a solution.
>>>
>>> As always any help/thoughts are much appreciated, except for that one
>>> guy's comments (you all know who I am talking) ~ jk ;)
>>>
>>> Thanks,
>>> `
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>> Have you actually profiled your code to see where the pain points are
>> vs saying 'module?' Are you also running an opcode cache? From there
>> you can use data, block, or full page caching. Finally you can figure
>> out if you want to store it in flat files or memory. I'd start by
>> knowing what is actually the slow part using Xdebug and nail a few
>> down.
>>
>> There is no end all solution. Some pages really don't have a lot
>> going on and are hardly updated so full page is fine. Others might
>> have something that is hard to generate on a sidebar, so block caching
>> would be more suitable for that. As previously mentioned, Zend_Cache
>> is up to the task. There is also a PEAR package called Cache_Lite
>> which would work to if you're interested in file based caching.
>>
>
> So dreams do come true...
>
> Thank you for the wonderful insight. I've been reading about the
> memcached and Xdebug and Zend_Cache. I've got lots to learn, but it is
> exactly the type of material i was trying to find.
>
> I am not currently running an opcode cache. I may be doing "premature
> optimization", but i want to design the entire system intelligently from
> the get go rather than having to rebuild later. you know 'work smarter
> not harder'....
>
> Is it possible to run xdebug on a virtual host server on which i do not
> have shell access? I can modify php.ini via cgi, but I don't know if
> i'd be able to view the results of xdebug on the machine. Your opinion
> would be appreciated.
>
> Thanks so much, i feel like i've just been shown a whole new world.
> dK
> `
I still have to (fully) rtfm. But i was wondering if the following
scenario(s) is(are) possible.
-Does memcached store the same data under different keys in the same spot?
>From my reading so far, i do not think so.
My understanding is that currently memcached goes like as follows:
key->key_hash->server->data_value
but this approach could conceivably store the same data_value under
different keys (thus consuming unneeded memory)
What i'd like it to do is the following:
key->key_hash->server->data_hash->server->data_value
That is, each key has the data_hash as its value. Then one uses this
data_hash as the new key which has the data_value as its value.
This way the only data that is replicated would be the relatively small
data_hash, but the (larger) data itself would not be replicated.
This would allow for the user to use different keys to access the same
data. This would be needed when seemingly different keys happen to
share the same data, but would be too costly to recognize, predict, and
accommodate such associations
This doubles the number of calls to the server, but could conceivable
save a great deal of memory for more cached objects. What would be even
slicker is if the programmer could use either approach within the same
script. For example, if the programmer new for (almost) certain that a
certain key would never have the same data signature as any other key,
she could then use the original method and save on the overhead of
storing key_hash to data_hashes pairs.
Also, I really like the idea behind zend_cache that I can use memcache/d
as the backend. That's pretty modular!
I have three direct questions:
1) Is the above approach wise or have i violated some basic caching
principle?
2) Is the php memcache/memcached class extendable (so that I can
implement 1 above)?
3) If 2) is yes, can I use this extendable class as the backend for
zend_cache?
Thanks,
dK
`
--- End Message ---
--- Begin Message ---
Why is date.timezone blank...I'm setting it in the config file?
How come PHP is ignorning teh directives I have set in the .ini?
OS X with PHP 5.3 compiled from source on Apache 2.2.9
WTF?
Here's my php.ini file:[Date]
; Defines the default timezone used by the date functions
date.timezone = America/New_York
date.default_latitude = 34.3044
date.default_longitude = -83.8338
;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333
But here's my phpinfo() output:
*Warning*: phpinfo()
[function.phpinfo<http://jcorry.localhost.com/function.phpinfo>]:
It is not safe to rely on the system's timezone settings. You are *required*
to use the date.timezone setting or the date_default_timezone_set()
function. In case you used any of those methods and you are still getting
this warning, you most likely misspelled the timezone identifier. We
selected 'America/New_York' for 'EDT/-4.0/DST' instead in *
/Users/jcorry/web_work/jcorry/httpdocs/info.php* on line *2*
date/time support enabled "Olson" Timezone Database Version 2009.10 Timezone
Database internal Default timezone America/New_York
DirectiveLocal ValueMaster Value date.default_latitude31.766731.7667
date.default_longitude35.233335.2333 date.sunrise_zenith90.58333390.583333
date.sunset_zenith90.58333390.583333 date.timezone*no value**no value*
--
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com
--- End Message ---