Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16320

Re: .configure memory_limit building from source

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.php
Subject Re: .configure memory_limit building from source
Date 2016-01-21 01:43 +0100
Organization PointedEars Software (PES)
Message-ID <3498422.n9LEhZzUnu@PointedEars.de> (permalink)
References (3 earlier) <569CDBAE.2010406@arnowelzel.de> <n7l03l$32s$4@dont-email.me> <569E70D8.9060304@arnowelzel.de> <n7mcva$s4l$1@dont-email.me> <569F1909.8020705@arnowelzel.de>

Show all headers | View raw


Arno Welzel wrote:

> crankypuss schrieb am 2016-01-19 um 23:25:
>> I don't see any need for a config file, all that stuff gets read in
>> during startup and replaces default values set by the build.
>> 
>> The objective of this little sub-project is to have a one-lump-
>> application written in PHP, that runs under any linux distro, whether
>> PHP is installed or not.  Originally I was thinking of modifying main()
>> so that it would determine how large the actual module is, then read the
>> remainder of the executable file and use that as it's PHP source.  I
>> might still go with that approach, undetermined yet, but if I do I'll
>> need to strip some of the extraneous funtionality out.
> 
> Than you also have to link every library statically to the PHP binary

I am not sure about that; it may be possible to set LD_LIBRARY_PATH just for 
the php(1) invocation.

> and omit nearly every extension - otherwise the binary may depend on
> certain runtime libaries which are not found on the distribution or they
> are not provided in the right version.
> 
> Well - I think it's easier to use shell scripts then ;-).

Apropos, there are several ways to run php(1) without the system’s php.ini:

-c  specifies the php.ini file to use; you can write a temporary php.ini to
    ${TMPDIR:-/tmp} (using mktemp(1)) when invoking php(1) in case named
    pipes, with which you can generate a php.ini on the fly (see example
    below), are not supported;

-n  specifies that no php.ini file is used, falling back to the compiled 
    defaults; try e.g. “php -n -r 'phpinfo(INFO_GENERAL);'”

-d  allows to set php.ini directives on the command line, so with “-n”
    you do not need the workaround with “-c”.

Example:

$ ls Application.php
ls: cannot access Application.php: No such file or directory

$ php -c <(echo 'include_path = /LCARS/scripts/php') \
      -r 'require_once "Application.php";'
[no error]

  or

$ php -n -d include_path=/LCARS/scripts/php \
         -r 'require_once "Application.php";'
[no error]

See also: php --help
 
-- 
PointedEars
Zend Certified PHP Engineer 
<http://www.zend.com/en/yellow-pages/ZEND024953> | Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

.configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-17 15:59 -0700
  Re: .configure memory_limit building from source "Peter H. Coffin" <hellsop@ninehells.com> - 2016-01-17 21:56 -0600
    Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-18 02:38 -0700
      Re: .configure memory_limit building from source "J.O. Aho" <user@example.net> - 2016-01-18 13:08 +0100
        Re: .configure memory_limit building from source Michael Vilain <vilain@NOspamcop.net> - 2016-01-18 17:48 -0800
          Re: .configure memory_limit building from source "J.O. Aho" <user@example.net> - 2016-01-19 06:56 +0100
            Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-19 02:37 -0700
      Re: .configure memory_limit building from source Arno Welzel <usenet@arnowelzel.de> - 2016-01-18 13:33 +0100
        Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-19 02:39 -0700
          Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-19 03:54 -0700
            Re: .configure memory_limit building from source Arno Welzel <usenet@arnowelzel.de> - 2016-01-19 18:27 +0100
              Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-19 14:38 -0700
                Re: .configure memory_limit building from source Arno Welzel <usenet@arnowelzel.de> - 2016-01-20 06:11 +0100
          Re: .configure memory_limit building from source Arno Welzel <usenet@arnowelzel.de> - 2016-01-19 18:22 +0100
            Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-19 15:25 -0700
              Re: .configure memory_limit building from source Arno Welzel <usenet@arnowelzel.de> - 2016-01-20 06:20 +0100
                Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-20 03:02 -0700
                Re: .configure memory_limit building from source Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-21 01:43 +0100
  Re: .configure memory_limit building from source Arno Welzel <usenet@arnowelzel.de> - 2016-01-18 09:07 +0100
    Re: .configure memory_limit building from source crankypuss <invalid@invalid.invalid> - 2016-01-18 02:39 -0700
      Re: .configure memory_limit building from source Matthew Carter <m@ahungry.com> - 2016-01-18 21:21 -0500

csiph-web