php embedded

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Captain Dondo

    php embedded

    I am working on an embedded platform which will serve a small number of
    dynamic webpages. Right now we are looking at php+javascript with
    apache as the webserver.

    Do we need to compile the entire php tarball or is the php module in
    apache enough to run php? Similarly, what is the minimum configuration
    of php we need, assuming we only need to access flat-file ascii data?

    Does anyone of any how-tos or guides for compiling php for embedded
    platforms?

    Thanks,

    --Yan
  • Justin Koivisto

    #2
    Re: php embedded

    Captain Dondo wrote:[color=blue]
    > I am working on an embedded platform which will serve a small number of
    > dynamic webpages. Right now we are looking at php+javascript with
    > apache as the webserver.
    >
    > Do we need to compile the entire php tarball or is the php module in
    > apache enough to run php? Similarly, what is the minimum configuration
    > of php we need, assuming we only need to access flat-file ascii data?[/color]

    The first question is what is the embedded platform? (Windows, linux, etc.?)

    If you are loading the php module for apache, you either have already
    compiled the php source, or do not need to unless you need additional
    features.

    How do you plan on accessing the files? (which functions, etc.)

    I'm betting that you'd be spending most of your time deciding which
    extensions to *disable* rather than enable.

    --
    Justin Koivisto, ZCE - justin@koivi.co m

    Comment

    • Captain Dondo

      #3
      Re: php embedded

      Justin Koivisto wrote:[color=blue]
      > Captain Dondo wrote:
      >[color=green]
      >>I am working on an embedded platform which will serve a small number of
      >>dynamic webpages. Right now we are looking at php+javascript with
      >>apache as the webserver.
      >>
      >>Do we need to compile the entire php tarball or is the php module in
      >>apache enough to run php? Similarly, what is the minimum configuration
      >>of php we need, assuming we only need to access flat-file ascii data?[/color]
      >
      >
      > The first question is what is the embedded platform? (Windows, linux, etc.?)[/color]

      Linux on arm, basically running a very stripped system.
      [color=blue]
      > If you are loading the php module for apache, you either have already
      > compiled the php source, or do not need to unless you need additional
      > features.[/color]

      I guess my question is: "If I have the apache module, do I need any
      other php-related stuff - libraries, modules, etc?"
      [color=blue]
      >
      > How do you plan on accessing the files? (which functions, etc.)[/color]

      All the PHP routines will do is read in a file, pre-fill a form, and
      then write out the file based on form submission.
      [color=blue]
      >
      > I'm betting that you'd be spending most of your time deciding which
      > extensions to *disable* rather than enable.[/color]

      Exactly. I'm hoping someone has a guide out there on how to strip out
      all those things I don't need...
      [color=blue]
      >[/color]

      Comment

      • Justin Koivisto

        #4
        Re: php embedded

        Captain Dondo wrote:[color=blue]
        > Justin Koivisto wrote:
        >[color=green]
        >> Captain Dondo wrote:
        >>[color=darkred]
        >>> I am working on an embedded platform which will serve a small number of
        >>> dynamic webpages. Right now we are looking at php+javascript with
        >>> apache as the webserver.
        >>>
        >>> Do we need to compile the entire php tarball or is the php module in
        >>> apache enough to run php? Similarly, what is the minimum configuration
        >>> of php we need, assuming we only need to access flat-file ascii data?[/color]
        >>
        >> The first question is what is the embedded platform? (Windows, linux,
        >> etc.?)[/color]
        >
        > Linux on arm, basically running a very stripped system.
        >[color=green]
        >> If you are loading the php module for apache, you either have already
        >> compiled the php source, or do not need to unless you need additional
        >> features.[/color]
        >
        > I guess my question is: "If I have the apache module, do I need any
        > other php-related stuff - libraries, modules, etc?"[/color]

        Only if the code you write (or install) in PHP needs them. That would
        then bring up more questions, of which the most important is:

        Will the php code be embedded as well, or will others have the
        opportunity to run their own code on this embedded system?
        [color=blue][color=green]
        >> How do you plan on accessing the files? (which functions, etc.)[/color]
        >
        > All the PHP routines will do is read in a file, pre-fill a form, and
        > then write out the file based on form submission.[/color]

        Is this something similar to a firewall configuration? If so, then you
        won't likely need other libraries or modules if the scripts don't need them.
        [color=blue][color=green]
        >> I'm betting that you'd be spending most of your time deciding which
        >> extensions to *disable* rather than enable.[/color]
        >
        > Exactly. I'm hoping someone has a guide out there on how to strip out
        > all those things I don't need...[/color]

        There won't be a guide as it will depend on the intended use (as per
        above statements).

        The way I'd go about this is to first compile the default configuration
        and see what was enabled by viewing the output of php_info(). From
        there, you should be able to "--without-PACKAGE" where necessary until
        you think you have the minimum that your code needs. My suggestion about
        this route is to disable no more than 2 or 3 extensions at a time and
        test - especially if you didn't write the PHP code.

        HTH

        --
        Justin Koivisto, ZCE - justin@koivi.co m

        Comment

        • Chung Leong

          #5
          Re: php embedded

          Captain Dondo wrote:[color=blue]
          > I am working on an embedded platform which will serve a small number of
          > dynamic webpages. Right now we are looking at php+javascript with
          > apache as the webserver.[/color]

          What kind of hardware resources is available? Both PHP and Apache are
          fairly large.
          [color=blue]
          > Do we need to compile the entire php tarball or is the php module in
          > apache enough to run php? Similarly, what is the minimum configuration
          > of php we need, assuming we only need to access flat-file ascii data?[/color]

          It's been a while since I compiled PHP on Linux. I don't believe the
          language core compiles into a separate dynamically loaded library as it
          does on Windows. The Apache module should be all you need. There are a
          number of extensions that are included by default. Look at the options
          available to the autoconf script for more info. Around 400 functions
          are bundled in the standard extension and cannot be removed without
          altering the source. So even if you will never call highlight_sourc e()
          or convert_cyr_str ing(), you're more or less stuck with them.

          Comment

          • C.

            #6
            Re: php embedded

            "fairly large" - well yes. It sounds like this will not be a high
            volume webserver, but with an ARM processor, there should be enough CPU
            to get it running. I'd definitely consider ditching apache and using
            thttpd or monkey or even one of the webservers written in PHP.

            When I looked after production systems I prefered using prebuilt rpms
            (along with a good upgrade tool) - it made management so much easier -
            but I did build php5 with MySQL, GD, PECL and SQLLite. The stripped
            binary was about 1Mb.

            HTH

            C.

            Comment

            Working...