Skip to content

Commit

Permalink
added instructions on building runkit module for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zenovich committed Dec 10, 2011
1 parent 25edc2a commit ee43586
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Runkit has three groups of features outlined below:


[CUSTOM SUPERGLOBALS]
A new .ini entry `runkit.superglobal` is defined which may be specified as a simple variable, or list of simple variables to be registered as
A new .ini entry `runkit.superglobal` is defined which may be specified as a simple variable, or list of simple variables to be registered as
superglobals. runkit.superglobal is defined as PHP_INI_SYSTEM and must be set in the system-wide php.ini.

Example:
Expand Down Expand Up @@ -45,8 +45,8 @@ Compatability: PHP4 and PHP5


[SANDBOXING]
With the introduction of TSRM based subinterpreter support a running PHP script may now generate a new thread and interactively switch contexts back and
forth between it. THIS FEATURE DOES NOT PROVIDE FULL SCRIPT THREADING. This feature only allows you to run processes in a subinterpreter optionally
With the introduction of TSRM based subinterpreter support a running PHP script may now generate a new thread and interactively switch contexts back and
forth between it. THIS FEATURE DOES NOT PROVIDE FULL SCRIPT THREADING. This feature only allows you to run processes in a subinterpreter optionally
with additional security.

First, create an instance of the Runkit_Sandbox object:
Expand All @@ -68,10 +68,10 @@ $php->eval('echo "The value of foo is $foo\n";');

In this example, $foo will be interpolated as 'bar' since that's what you set it to earlier.

Certain INI Options which are ordinarily only modifiable in the system php.ini may be passed during instantiation and changed for your subinterpreter as
Certain INI Options which are ordinarily only modifiable in the system php.ini may be passed during instantiation and changed for your subinterpreter as
well, these options are passed as an associative array to the Runkit_Sandbox constructor and include the following:

safe_mode safe_mode may only be turned on for a Runkit_Sandbox interpreter using this option. It cannot be turned off, doing so would
safe_mode safe_mode may only be turned on for a Runkit_Sandbox interpreter using this option. It cannot be turned off, doing so would
circumvent the setting specified by your system administrator in the system php.ini.

open_basedir Like safe_mode, you can only use this setting to make things more restrictive.
Expand All @@ -82,9 +82,9 @@ disable_functions Any function names specified in this coma-delimited list will

disable_classes Like disable_functions, this list is in addition to already disabled classes.

Sandboxing is ONLY AVAILABLE in PHP 5.1 (release version, or snapshot dated after April 28th, 2005) when thread safety has been enabled. To enable
thread safety, just make sure that --enable-maintainer-zts is specified on your ./configure line. This doesn't necessarily mean that your SAPI will use
PHP in a threaded manner, just that PHP is prepared to behave that way. If you're building for Apache2-Worker then you're already built for thread
Sandboxing is ONLY AVAILABLE in PHP 5.1 (release version, or snapshot dated after April 28th, 2005) when thread safety has been enabled. To enable
thread safety, just make sure that --enable-maintainer-zts is specified on your ./configure line. This doesn't necessarily mean that your SAPI will use
PHP in a threaded manner, just that PHP is prepared to behave that way. If you're building for Apache2-Worker then you're already built for thread
safety.

If you wish/need to use PHP 5.0.x, or a cvs snapshot of 5.1 which predates April 28th, you can apply the tsrm_5.0.diff patch included in this package:
Expand All @@ -96,3 +96,30 @@ Then just rebuild using the --enable-maintainer-zts option specified above.


runkit_lint() and runkit_lint_file() also exist as a simpler approach to verifying the syntactic legality of passed code within an isolated environment.


[BUILDING THE RUNKIT MODULE FOR WINDOWS]
First, place source code of runkit into a temporary directory, for example "C:\runkit-source".
Open your Windows SDK command prompt or Visual Studio Command prompt.
Then change into the runkit's source code directory:

C:
cd C:\runkit-source

After that, run phpize from your PHP SDK. This may be something like

C:\php\SDK\phpize.bat

Then configure your runkit module by executing "configure". You can view the full list of options by the command

configure --help

but in most cases, you probably will choose a simple command

configure --enable-runkit

After all run

nmake

Now you should have the "php_runkit.dll" file.

0 comments on commit ee43586

Please sign in to comment.