top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Compiler for the PHP code

0 votes
584 views

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.

posted Mar 19, 2013 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

4 Answers

0 votes
 
Best answer

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

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)

answer Mar 19, 2013 by anonymous
0 votes

I am using bcompiler for my projects.
http://pecl.php.net/package/bcompiler

It seems effective.

answer Mar 19, 2013 by anonymous
0 votes

Please install and use the PECL bcompiler extension. You
will need to use the appropriate version for your php

answer Mar 19, 2013 by anonymous
0 votes

PHP gets compiled to bytecode on the server before being executed.
You can cache the pre-compiled 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.
answer Mar 19, 2013 by anonymous
Similar Questions
0 votes

I have downloaded HipHop for my website, I am going through various web links which are suggesting that performance will improve 3-6 times. However I don't know the Stability of the HipHop.

Please provide your inputs so that I can decide to use HipHop.

+10 votes

I want to save a password in encrypted form, so that it will not be understand by human. Is it possible ? If yes then please explain briefly.

+1 vote

I am using the sublime text 2 plugin for PHP Coding Standards Fixer. It is working fine, except for the fact that it considers the namespace invalid (it is in fact invalid and I'm okay with it). this errors halts the script from correcting the rest of the file. I get the following error:

The namespace Application\Controllers\Admin in <filepath> does not match the file path according to PSR-0 rules.

How can I tell the the script to ignore the namespace constraint. Both command line arguments and Sublime text 2 user settings can be changed.

+1 vote

I have a web application written in PHP. It have been running for several years. Now I want to run it as a stand-alone application on an Android smartphone or tablet. How can I do it?

0 votes

I am having an string which was have few ' (single quote) and few " (double quotes) and was not able to insert into the mysql database. I have replaced them with \' and \" and everything is fine.
Though this are fine now but don't understand the working and I could have missed few corner cases also. Please suggest the working and also if there is some better way to achieve this.

...