php-general Digest 23 May 2012 02:19:26 -0000 Issue 7822

Topics (messages 317926 through 317931):

Re: requesting comments on rajmvServiceLog (access + error logging through PHP 
and JS to MySQL)
        317926 by: rene7705
        317927 by: marco.behnke.biz
        317928 by: rene7705

Differences between PHP on LAMP and PHP on Windows Servers
        317929 by: Gates, Jeff
        317930 by: Ashley Sheridan

How to handle E_ERROR,E_PARSE with a user defined function
        317931 by: Yuchen Wang

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Tue, May 22, 2012 at 2:54 PM, rene7705 <rene7...@gmail.com> wrote:
> On Tue, May 22, 2012 at 12:32 PM, rene7705 <rene7...@gmail.com> wrote:
>> On Tue, May 22, 2012 at 2:32 AM, tamouse mailing lists
>> <tamouse.li...@gmail.com> wrote:
>>> On Mon, May 21, 2012 at 7:31 AM, rene7705 <rene7...@gmail.com> wrote:
>>>> On Mon, May 21, 2012 at 1:17 PM, Simon Schick
>>>> <simonsimc...@googlemail.com> wrote:
>>>>> Specially the function rajmvServiceLog_graphs_raphael_calculateData() 
>>>>> with a
>>>>> code of ca. 280 lines is quite long ...
>>>>
>>>> 280 lines is long?! :)
>>>
>>> In general, yes. 280 lines is long. Too long, likely. Usually it
>>> indicates you aren't designing your code in a top-down fashion, and it
>>> is a high candidate for refactoring in order to break out into
>>> reusable functions. A rule of thumb is no more than 50 lines per
>>> function, most much less. Back in the day when we didn't have nifty
>>> gui screens and an 24 line terminals (yay green on black!), if a
>>> function exceeded one printed page, it was deemed too long and marked
>>> for refactoring.
>>
>> Well, I split up that long function into several new functions (using
>> pass-by-reference) this morning..
>> Problem is, now it won't work anymore due to memory consumption errors! :(
>>
>> I'd love to know what I'm doing wrong here.
>>
>> Demo at http://skatescene.biz/sites/mediabeez.ws/stats
>> Code is attached to this mail.
>
> hmm, this might actually be an issue with my dev webserver... it's
> taking 400mb of memory and over 10 minutes to process just 3500
> records.
> My live hosting does 2200 records in 64M of memory and significantly less 
> time..
>
> I'll keep digging.

Seems to be the writing of the html+json data to a file that's causing
the delay on my dev server.

Doing the totals calculation on my dev server for 3500 records takes
about 2.5 seconds, with the old code.
Will soon see how long it takes with the refactored code of today.

Anyone got a clue about why a few ten thousand calls to fwrite() will
slow down a wampserver so much?...

--- End Message ---
--- Begin Message ---

rene7705 <rene7...@gmail.com> hat am 22. Mai 2012 um 15:23 geschrieben:

> Seems to be the writing of the html+json data to a file that's causing
> the delay on my dev server.
>
> Doing the totals calculation on my dev server for 3500 records takes
> about 2.5 seconds, with the old code.
> Will soon see how long it takes with the refactored code of today.
>
> Anyone got a clue about why a few ten thousand calls to fwrite() will
> slow down a wampserver so much?...

Maybe the hdd is not caching properly and is constantly writing and
re-arranging the data?
Is your hdd a bit to much fragmented?

Just 2 guesses.


>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

--- End Message ---
--- Begin Message ---
On Tue, May 22, 2012 at 3:31 PM, ma...@behnke.biz <ma...@behnke.biz> wrote:
>
>
> rene7705 <rene7...@gmail.com> hat am 22. Mai 2012 um 15:23 geschrieben:
>
>> Seems to be the writing of the html+json data to a file that's causing
>> the delay on my dev server.
>>
>> Doing the totals calculation on my dev server for 3500 records takes
>> about 2.5 seconds, with the old code.
>> Will soon see how long it takes with the refactored code of today.
>>
>> Anyone got a clue about why a few ten thousand calls to fwrite() will
>> slow down a wampserver so much?...
>
> Maybe the hdd is not caching properly and is constantly writing and
> re-arranging the data?
> Is your hdd a bit to much fragmented?
>

my windowze dev box is completely frozen at startup now, before even
mounting the drive that had the slow write rate today. booted into
ubuntu which is still responsive, and ran disk utility to see that
smart status and self-check for both system drive and the other drive
that i noticed going slow today, is "good".
I wonder what's gotten my dev box ill.. Hope it aint a virus, but
can't start the virus scanner coz the thing is frozen... :S


> Just 2 guesses.
>
>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
> Marco Behnke
> Dipl. Informatiker (FH), SAE Audio Engineer Diploma
> Zend Certified Engineer PHP 5.3
>
> Tel.: 0174 / 9722336
> e-Mail: ma...@behnke.biz
>
> Softwaretechnik Behnke
> Heinrich-Heine-Str. 7D
> 21218 Seevetal
>
> http://www.behnke.biz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Can anyone tell me what differences I might encounter by working with PHP on a 
Unix server verses working with PHP on a Windows server. We use Windows 
production servers here but many of us would like to get more LAMP environments.

So, I'm wondering if I can use the hive mind here to get a sense of the pros 
and cons of each platform.

Thanks.

Jeff

--- End Message ---
--- Begin Message ---
On Tue, 2012-05-22 at 14:15 -0400, Gates, Jeff wrote:

> Can anyone tell me what differences I might encounter by working with PHP on 
> a Unix server verses working with PHP on a Windows server. We use Windows 
> production servers here but many of us would like to get more LAMP 
> environments.
> 
> So, I'm wondering if I can use the hive mind here to get a sense of the pros 
> and cons of each platform.
> 
> Thanks.
> 
> Jeff
> 


The first difference I'd point out is things like filenames and paths.
*nix systems are case sensitive, so script.php and Script.php are two
totally different files which can happily exist within the same
directory, whereas on a Windows system this isn't true. This can affect
anything from front-end assets (images, CSS, Javascript files, etc) to
PHP includes and even MySQL tables depending on how the database is
configured (it tends to create database files based on the name of the
DB and it's tables)

Also, the path separator is different. Unix/Linux uses a forward slash
and Windows uses a back-slash. While these can be interchanged quite
often without the world imploding, sometimes they just refuse to, so
it's best to ensure you're using the right one for the script. PHP has
several constants defined to help you which change depending on the
system PHP is currently being run on, you can find out more about them
at http://php.net/manual/en/dir.constants.php 

After that, you have file permissions. In Unix, you have file, owner and
group permissions; Windows has read/write permissions and I believe on
newer versions you can get something similar to what Unix/Linux has had
for the last however many years but I'm not 100% sure on that one.

There are differences with setting up PHP to send emails. On Windows I
believe you have to use SMTP, but on Linux you tend to use the internal
sendmail with the choice of SMTP if you wish.

In the main, I'd say that you want your production servers to mirror the
live ones as closely as possible. There have been plenty of times where
I've moved a script to a different machine and things have stopped
working because of a different version of PHP or MySQL was installed,
and you run the risk further if the OS is different too. When you're on
a deadline, the last thing you want is to have to debug something that
you know works just fine!

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hi all,

How to handle E_ERROR,E_PARSE with a user defined function ?

-- 
*Yuchen Wang*

--- End Message ---

Reply via email to