Integrating C Code into PHP scripts?

Discussion in 'PHP' started by fecophobia, Mar 5, 2006.

  1. #1
    I want to modify osDate to do astrology searches, so I need to insert astrological data into the database, but my source for the calculations is written in C. Should I make it an ActiveX control, or is there some way I can get it to execute server side and insert the data without downloading anything? What is the best way to integrate C code into a server-side application?
     
    fecophobia, Mar 5, 2006 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    I came across this once in a math situation. I dunno if this is correct, but I was told a C extension of PHP could be made to be called. However, the effort seemed a bit much. Not that I remember what to do. :/
     
    noppid, Mar 5, 2006 IP
  3. tccoder

    tccoder Peon

    Messages:
    69
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes there is a c based extension for apache, I cant remmeber exactly what it is but it allows you to code web applications with apache in c.

    This could be a good way for you to convert your program into a web application without the hassle of recoding.
     
    tccoder, Mar 7, 2006 IP
  4. fecophobia

    fecophobia Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well, there are three different kinds of extensions from what I came across. The most ambitious is to the engine, but it can be done in two other ways that are less ambitious. Those other two kinds of extensions don't force the server to have to run your special PHP engine. I can't quite remember the specifics, but the simplest of the two was one in which the extension is compiled in it's own environment for simply returning data to PHP.

    But at the moment I'm hung up deciding on a CMS. I want forum-like blogs that are rated threads, to be displayed as part of a complex Flash interface. Rated threads is unusual, I haven't seen that anywhere yet. I have seen at least one CMS that is supposedly geared specifically for Flash, but I am dubious.
     
    fecophobia, Mar 13, 2006 IP
  5. coderdan

    coderdan Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can write a C extension for PHP. The documentation is here:www.zend[dot]com/apidoc/ . If speed is not your main concern you can also write small program and and call it with something like exec/system/etc. This is much flexible. You have take care when coding as there are a lot of security risks apply any method.
     
    coderdan, Mar 18, 2006 IP