hoq to combine php and C ? or use php in C or the other way around?

Discussion in 'PHP' started by w47w47, Sep 22, 2010.

  1. #1
    also... the owner of torrentz.com told me that he somehow combines php and C to run the scripts faster... but he doesn't have enought time to explain to me how he does it.

    does anyone here know how to do this?

    it would be nice if someone could show me an example for echo 'example'; in C combined with PHP.

    thank you
     
    w47w47, Sep 22, 2010 IP
  2. axelay

    axelay Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cannot combine C and php
    However what you can do is find a compiler for PHP.

    Let me explain a little bit, PHP is an interpreted language which means that everytime a request is made to the server, php executes the code and outputs the result.
    a compiled language like C is basically a set of DLLs where some part of the code has been pre-processed to be able to serve pages faster.

    One good example is HipHop for PHP used by the Facebook nerds: http://wiki.github.com/facebook/hiphop-php/


    Hope that explains a bit more ;)

    aXe
     
    axelay, Sep 22, 2010 IP
  3. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    tnx that helped a lot. :) so i just have to get myself a compiler for php and compile the script. ;)
     
    w47w47, Sep 24, 2010 IP