php-general Digest 20 Mar 2013 14:19:45 -0000 Issue 8170

Topics (messages 320649 through 320659):

Re: Compiler for the PHP code
        320649 by: Camille Hodoul
        320650 by: Vincent Tumwijukye
        320651 by: Adam Nicholls
        320652 by: Alessandro Pellizzari

SPL Recursive Iterator Examples
        320653 by: NaMarPi
        320654 by: Alain Williams
        320655 by: NaMarPi
        320656 by: marco.behnke.biz
        320657 by: NaMarPi

Re: Compiler for the PHP code (memecached)
        320658 by: Daevid Vincent

javascript cookie dissapears when adding session_start()
        320659 by: Norah Jones

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 ---
Googling "compile php code" gave me this :
http://stackoverflow.com/questions/1408417/can-you-compile-php-code
It looks like you have some options but I haven't tried any yet, so I can't
help you with the installation


2013/3/19 Kevin Peterson <qh.res...@gmail.com>

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.
> Please suggest if we have any compiler option available for the PHP code
> and more important is this new option.
>
>


-- 
Camille Hodoul
http://camille-hodoul.com/

--- End Message ---
--- Begin Message ---
Dear Kevin, please install and use the PECL bcompiler extension. You will
need to use the approprate version for your php

regards

On Tue, Mar 19, 2013 at 11:46 AM, Kevin Peterson <qh.res...@gmail.com>wrote:

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.
> Please suggest if we have aany compiler option available for the PHP code
> and more important is this new option.
>
>


-- 
Tumwijukye Vincent
Chief Executive Officer
Future Link Technologies
Plot 78 Kanjokya Street,
P. O. BOX 75408,
KAMPALA - UGANDA
Tel: +256(0)774638790
Off:+256(0)41531274
Website: www.fl-t.com, www.savingsplus.info

--- End Message ---
--- Begin Message ---
Checkout HipHop by the Facebook guys, it turns PHP into C code and compiles 
down to binary. 

...although I don't think it's for the faint hearted.

Have you tried other optimisation techniques first - eg Caching, and 
Profiling?? If this is a production environment you might wanna think about 
increasing resources or introducing a load balancer (in the case of PHP based 
websites)

Cheers
Ads.


Sent from my BlackBerry® wireless device

-----Original Message-----
From: Camille Hodoul <camille.hod...@gmail.com>
Date: Tue, 19 Mar 2013 09:52:14 
To: Kevin Peterson<qh.res...@gmail.com>
Cc: <php-gene...@lists.php.net>
Subject: Re: [PHP] Compiler for the PHP code
Googling "compile php code" gave me this :
http://stackoverflow.com/questions/1408417/can-you-compile-php-code
It looks like you have some options but I haven't tried any yet, so I can't
help you with the installation


2013/3/19 Kevin Peterson <qh.res...@gmail.com>

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.
> Please suggest if we have any compiler option available for the PHP code
> and more important is this new option.
>
>


-- 
Camille Hodoul
http://camille-hodoul.com/


--- End Message ---
--- Begin Message ---
Il Tue, 19 Mar 2013 08:46:22 +0000, Kevin Peterson ha scritto:

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.

PHP gets compiled to bytecode on the server before being executed.
You can cache the precompiled code with (for example) APC.
Unless your code is several thousand lines of code (or your server very 
slow... 486-slow), the compilation phase is not that long.

I think your main problem can be one of:

1- wrong algorithm

2- long waits (database, files, network, etc.)

3- heavy calculations


Solutions:

1- find and use a different algorithm

2- Try to parallelize code (with gearman or similar, or via pctnl_fork)

3- rewrite the heavy functions in C, C++ or Go and compile them, then 
call them via PHP extensions or via gearman/fork.

Bye.



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

I have not found enough documents about Recursive Iterators on the net, so 
started to collect my mini-examples here:


https://github.com/namarpi/PHP-SPL-Recursive-Examples


--- End Message ---
--- Begin Message ---
On Tue, Mar 19, 2013 at 04:40:59AM -0700, NaMarPi wrote:
> 
> 
> I have not found enough documents about Recursive Iterators on the net, so 
> started to collect my mini-examples here:
> 
> 
> https://github.com/namarpi/PHP-SPL-Recursive-Examples

If you are putting them up as examples, then it would be good if there were
plentiful comments that said what they were supposed to do, why, how ...

Regards

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>

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

The usage of the examples:

1. the name of the php file reflects to the method(s) under consideration -> 
find the related php.net manual page for more information

2. scroll down in the file, and you will find the result of the execution






----- Original Message -----
From: NaMarPi <nama...@yahoo.com>
To: "nama...@yahoo.com" <nama...@yahoo.com>
Cc: 
Sent: Tuesday, March 19, 2013 12:37 PM
Subject: SPL Recursive Iterator Examples




I have not found enough documents about Recursive iterators on the net, so 
started to colect mini-examples here:

https://github.com/namarpi/PHP-SPL-Recursive-Examples

--- End Message ---
--- Begin Message ---
Why don't you post them on php.net?

http://www.php.net/manual/add-note.php?sect=class.recursiveiterator&redirect=http://www.php.net/manual/de/class.recursiveiterator.php


> NaMarPi <nama...@yahoo.com> hat am 19. März 2013 um 13:01 geschrieben:
>
>
>
>
> The usage of the examples:
>
> 1. the name of the php file reflects to the method(s) under consideration ->
> find the related php.net manual page for more information
>
> 2. scroll down in the file, and you will find the result of the execution
>
>
>
>
>
>
> ----- Original Message -----
> From: NaMarPi <nama...@yahoo.com>
> To: "nama...@yahoo.com" <nama...@yahoo.com>
> Cc:
> Sent: Tuesday, March 19, 2013 12:37 PM
> Subject: SPL Recursive Iterator Examples
>
>
>
>
> I have not found enough documents about Recursive iterators on the net, so
> started to colect mini-examples here:
>
> https://github.com/namarpi/PHP-SPL-Recursive-Examples
>
> --
> 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 ---

Thanks, I have heard about that feature for the first time. I will examine it.



> Why don't you post them on php.net?

> http://www.php.net/manual/add-note.php?sect=class.recursiveiterator&redirect=http://www.php.net/manual/de/class.recursiveiterator.php
>
>
>> NaMarPi <nama...@yahoo.com> hat am 19. März 2013 um 13:01 geschrieben:
>>
>>
>>
>>
>> The usage of the examples:
>>
>> 1. the name of the php file reflects to the method(s) under consideration ->
>> find the related php.net manual page for more information
>>
>> 2. scroll down in the file, and you will find the result of the execution
>>
>>
>>
>>
>> I have not found enough documents about Recursive Iterators on the net, so
>> started to collect mini-examples here:
>>
>> https://github.com/namarpi/PHP-SPL-Recursive-Examples
>>
>> --
>> 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 ---

> -----Original Message-----
> From: Alessandro Pellizzari [mailto:a...@amiran.it]
> Sent: Tuesday, March 19, 2013 2:06 AM
> To: php-gene...@lists.php.net
> Subject: [PHP] Re: Compiler for the PHP code
> 
> Il Tue, 19 Mar 2013 08:46:22 +0000, Kevin Peterson ha scritto:
> 
> > My webcode written in PHP and it is running in the interpreted way. My
> > problem is it is not giving the desired performance so want to try the
> > compiler if any.
> 
> PHP gets compiled to bytecode on the server before being executed.
> You can cache the precompiled code with (for example) APC.
> Unless your code is several thousand lines of code (or your server very
> slow... 486-slow), the compilation phase is not that long.
> 
> I think your main problem can be one of:
> 
> 1- wrong algorithm
> 
> 2- long waits (database, files, network, etc.)
> 
> 3- heavy calculations
> 
> 
> Solutions:
> 
> 1- find and use a different algorithm
> 
> 2- Try to parallelize code (with gearman or similar, or via pctnl_fork)
> 
> 3- rewrite the heavy functions in C, C++ or Go and compile them, then call
> them via PHP extensions or via gearman/fork.

Another thing you can do is store both page "renders" as well as database 
results in http://memcached.org/ blobs and pull from those in intelligent ways 
(you can creatively mix and match "live" stuff with cached stuff and you can 
make pages expire in defined hours via your cache class or even a crontab).

We also add another layer in that if a blob exists in the memecached but not 
locally, we save it locally for the next hit. Depending on your hardware though 
the Gigabit/Fiber might be faster access than a local HD/SSD/RAM disk, so YMMV.

We use LAMP and our site gets > 30,000 hits per SECOND on two servers and 5 
pools.



--- End Message ---
--- Begin Message ---
I've been working on a PHP/Javascript Cookie Notify (Including multiple 
language support). Now I have one small problem, when session_start() is not at 
the top, the cookie message works as it should be. 
Now I am trying to add session_start(); at the top, as this will load the 
current language file the visitor has set it to. But then the cookie message 
will not show.
I've cleaned all my cookies, and still can't get it to work ...
I've put up a small code on jsFiddle, but when session_start(); is at the top, 
it launches correctly in jsFiddle. which can be viewed (here).
Does anyone know what i'm doing wrong? And would you be able to explain me what 
I am doing wrong?

Thanks


--- End Message ---

Reply via email to