SlideShare a Scribd company logo
PH7 Engine Introduction: http://ph7.symisc.net




      Introduction To Embedding PH7 PHP Engine in a C/C++ Host Application.
                                     November 08, 2012
                                    http://ph7.symisc.net/




                       Author: Mrad Chems Eddine <chm@symisc.net>




Copyright © Symisc Systems, SUARL
PH7 Engine Introduction: http://ph7.symisc.net




What is PH7
PH7 is a in-process software library that implements a highly-efficient embeddable bytecode
compiler and a virtual machine for the PHP programming language. In other words, PH7 is a
PHP engine which allow the host application to compile and execute PHP scripts in-process.
PH7 is to PHP what SQLite is to SQL.
PH7 implements most of the constructs introduced by the PHP 5.3 release such as heredoc,
nowdoc, gotos, classes, anonymous functions, closures and so on and introduces very powerful
extensions to the PHP programming language such as:

    •   Function & Method Overloading.
    •   Full Type Hinting.
    •   Introducing comma expressions.
    •   Introducing the eq and ne operators for strict string comparison.
    •   Improved operators precedences.
    •   Powerful OO subsystem.
    •   Function arguments can take any complex expressions as their default values.
    •   64-bit integer arithmetic for all platforms.
    •   Native UTF-8 support.
    •   PH7 is 100% hand-coded, written in ANSI C, compile and run unmodified in any
        platform including restricted embedded devices with a C compiler.
    •   Amalgamation: All C source code for PH7 are combined into a single source file.
    •   Built with more 470 function including an XML parser (with namespace support), INI
        processor, CSV reader/writer, UTF-8 encoder/decoder, zip archive extractor, JSON
        encoder/decoder, random number/strings generator, native and efficient File IO for
        Windows and UNIX systems and many more without the need of any external library to
        link with.
    •   PH7 is an Open-Source product.
                                            Refer to the feature page for a detailed description.



PH7 is the ideal library for enhancing your application (i.e: SCM, Server, CMS, Control panel,
Search engine, etc.) or device (i.e: router, set-top box, etc.) with dynamic web interfaces, with
all benefits and power of the PHP(5) programming language without the overhead uncured by
the insecure CGI mechanism and it's high costs such as process creation (fork(), exec()) since
PH7 run in-process.


As an embedded interpreter, it allows multiple interpreter states to coexist in the same
program, without any interference between them. Programmatically, foreign functions in C can
be added and values can be defined in the PHP environment. Being a quite small program, it is
easy to comprehend, get to grips with, and use.


PH7 is 100% hand-coded, written in ANSI C, compiles unmodified and should run in any
platform including restricted embedded device with a C compiler.
PH7 is extensively tested on Windows and UNIX systems especially Linux, FreeBSD, Oracle
Solaris and Mac OS X.



Copyright © Symisc Systems, SUARL
PH7 Engine Introduction: http://ph7.symisc.net


PH7 is a compact library. With all features enabled, the library size can be less than 600KiB,
depending on compiler optimization settings. (Some compiler optimizations such as aggressive
function inlining and loop unrolling can cause the object code to be much larger.) If optional
features are omitted, the size of the PH7 library can be reduced below 220KiB. PH7 can also be
made to run in very little heap (2MB), making PH7 a popular PHP engine choice on memory
constrained gadgets such as cellphones, tablets, numeric devices and so on.

PH7 is an open-source, dual-licensed product available free of charge for open-source projects
under the term of the Symisc Public License (SPL) which is a GPL compatible license and is
equivalent to the more popular Sleepycat license (An OSI approved license). See the
licensing page for additional information.

PH7 in 5 Minutes or Less
Here is what you do to start experimenting with the PH7 engine without having to do a lot of
tedious reading and configuration:


download The Code
Get a copy of the last public release of the PH7 engine. Visit the download page for more
information.

Write Programs That Use PH7
Below is a simple C program that demonstrates how to use the C/C++ interface to PH7. This
program compile and execute the following PHP script.




          <?php
            echo 'Welcome guest'.PHP_EOL;
            echo 'Current system time is: '.date('Y-m-d H:i:s').PHP_EOL;
            echo 'and you are running '.php_uname();
          ?>



That is, this simple PHP script when running should display a greeting message, the current
system time and the host operating system. A typical output of this program would look like
this:


              Welcome guest
              Current system time is: 2012-09-14 10:08:44
              and you are running Microsoft Windows 7 localhost 6.1 build 7600 x86




Here is the C code. Note that you can get a working version of this program here:




Copyright © Symisc Systems, SUARL
PH7 Engine Introduction: http://ph7.symisc.net


              1. #include "ph7.h"
              2. int main(void)
              3. {
              4. ph7 *pEngine; /* PH7 engine */
              5. ph7_vm *pVm; /* Compiled PHP program */
              6. int rc;
              7. /* Allocate a new PH7 engine instance */
              8. rc = ph7_init(&pEngine);
              9. if( rc != PH7_OK ){
              10. /*
              11. * If the supplied memory subsystem is so sick that we are unable
              12. * to allocate a tiny chunk of memory, there is no much we can do here.
              13. */
              14. Fatal("Error while allocating a new PH7 engine instance");
              15. }
              16. /* Compile the PHP test program defined above */
              17. rc = ph7_compile_v2(
              18.     pEngine, /* PH7 engine */
              19.     PHP_PROG, /* PHP test program */
              20.     -1 /* Compute input length automatically*/,
              21.     &pVm, /* OUT: Compiled PHP program */
              22.     0 /* IN: Compile flags */
              23. );
              24. if( rc != PH7_OK ){
              25. if( rc == PH7_COMPILE_ERR ){
              26.     const char *zErrLog;
              27.     int nLen;
              28.    /* Extract error log */
              29.     ph7_config(pEngine,
              30.       PH7_CONFIG_ERR_LOG,
              31.       &zErrLog,
              32.       &nLen
              33.    );
              34. if( nLen > 0 ){
              35.    /* zErrLog is null terminated */
              36.    puts(zErrLog);
              37. }
              38. }
              39. /* Exit */
              40. Fatal("Compile error");
              41.}
              42./*
              43. * Now we have our script compiled, it's time to configure our VM.
              44. * We will install an output consumer callback that redirect
              45. * the VM output to STDOUT (download the C file to see the implementation).
              46. */
              47.rc = ph7_vm_config(pVm,
              48.        PH7_VM_CONFIG_OUTPUT,
              49.       Output_Consumer, /* Output Consumer callback */
              50.       0 /* Callback private data */
              51. );
              52. if( rc != PH7_OK ){
              53.    Fatal("Error while installing the VM output consumer callback");
              54. }

Copyright © Symisc Systems, SUARL
PH7 Engine Introduction: http://ph7.symisc.net


              55./*
              56.* And finally, execute our program. Note that your output (STDOUT in our
                 case)
              57.* should display the result.
              58.*/
              59. ph7_vm_exec(pVm,0);
              60./* All done, cleanup the mess left behind.
              61.*/
              62. ph7_vm_release(pVm);
              63. ph7_release(pEngine);
              64.return 0;
              65.}
                                                                          Download the C file.
We create a new PH7 engine instance using a call to ph7_init() on line 8. This is often the first
PH7 API call that an application makes and is a prerequisite in order to compile PHP code using
one of the compile interfaces.
We compile our PHP test program on line 17 using the ph7_compile_v2() interface.
We configure our Virtual Machine on line 47 by setting a VM output consumer callback named
Output_Consumer() (Download the C file to see the implementation). All this callback does is
redirecting the VM output to STDOUT using the libc printf() routine or the write() system call.
And finally we execute our PHP program on line 59 using a call to ph7_vm_exec(). You should
see now the greeting message, the current date and the host operating system.
Clean-up is done on line 62 and 63 respectively via calls to ph7_vm_release() and
ph7_release().


Compile the program
Compile this C file together with the PH7 engine source code to generate the executable. For
example:
                      gcc -W -Wall -O6 -o ph7_test ph7_intro.c ph7.c
When running [./ph7_test ] you should see the greeting message, the current system time and
the host operating system.


Stand-alone Interpreter For PH7
The PH7 download page includes a simple stand-alone PHP interpreter named ph7 (or
ph7.exe on windows) that allows the user to enter and execute PHP files against a PH7
engine. This utility is available in prebuilt binaries forms or can be compiled from source. You
can get a copy of the PH7 interpreter from the download page.
To start the ph7 program, just type "ph7" followed by the name of the PHP file to compile and
execute. That is, the first argument is to the interpreter, the rest are scripts arguments, press
"Enter" and the PHP code will be executed.
If something goes wrong while processing the PHP script due to a compile-time error, your
error output (STDOUT) should display the compile-time error messages.


Usage example of the ph7 interpreter:
Running the interpreter
ph7 scripts/hello_world.php


Copyright © Symisc Systems, SUARL
PH7 Engine Introduction: http://ph7.symisc.net


Running the interpreter with script arguments
ph7 scripts/mp3_tag.php /usr/local/path/to/my_mp3s


The PH7 interpreter package includes more than 70 PHP scripts to test ranging from simple
hello world programs to XML processing, zip archive extracting, MP3 tag extracting, UUID
generation, JSON encoding/decoding, INI processing, Base32 encoding/decoding and many
more. These scripts are available in the scripts directory from the zip archive.


Next
Check out the Introduction To The PH7 C/C++ Interface for an introductory overview and
roadmap to the dozens of PH7 interface functions.
A separate document, The PH7 C/C++ Interface, provides detailed specifications for all of the
various C/C++ APIs for PH7. Once the reader understands the basic principles of operation for
PH7, that document should be used as a reference guide.
Any questions, check the Frequently Asked Questions page or visit the Support Page for online
community support.
                                         PH7 Engine Homepage: http://ph7.symisc.net/




Copyright © Symisc Systems, SUARL

More Related Content

PDF
ARM Trusted FirmwareのBL31を単体で使う!
PDF
Linux : PSCI
TXT
Centos config
PDF
LCU14-103: How to create and run Trusted Applications on OP-TEE
PPTX
Python at Facebook
PDF
Tegra 186のu-boot & Linux
PDF
このPHP拡張がすごい!2017
PDF
5 p9 pnor and open bmc overview - final
ARM Trusted FirmwareのBL31を単体で使う!
Linux : PSCI
Centos config
LCU14-103: How to create and run Trusted Applications on OP-TEE
Python at Facebook
Tegra 186のu-boot & Linux
このPHP拡張がすごい!2017
5 p9 pnor and open bmc overview - final

What's hot (20)

PDF
OpenFOAM 2.4.0 installation on CentOS-7
PDF
HKG15-311: OP-TEE for Beginners and Porting Review
PDF
Source pack installation of OpenFOAM.4.0 into RHL
PDF
Divorcing System
PPT
Composing and Executing Parallel Data Flow Graphs wth Shell Pipes
PPTX
Demystify eBPF JIT Compiler
PPT
Php Ppt
PDF
eBPF Tooling and Debugging Infrastructure
PDF
6 open capi_meetup_in_japan_final
PDF
Bare metal performance in Elixir
KEY
Ein Stall voller Trüffelschweine - (PHP-)Profiling-Tools im Überblick
PDF
L.A.M.P Installation Note --- CentOS 6.5
PDF
4. open mano set up and usage
PPTX
Thrift+scribe实现分布式日志收集,并与log4j集成
PDF
PRoot improved kernel compatibility
ODP
eBPF maps 101
PDF
from Binary to Binary: How Qemu Works
PDF
Secure PHP environment
PPTX
20111011 bigbluebutton
PDF
USENIX Vault'19: Performance analysis in Linux storage stack with BPF
OpenFOAM 2.4.0 installation on CentOS-7
HKG15-311: OP-TEE for Beginners and Porting Review
Source pack installation of OpenFOAM.4.0 into RHL
Divorcing System
Composing and Executing Parallel Data Flow Graphs wth Shell Pipes
Demystify eBPF JIT Compiler
Php Ppt
eBPF Tooling and Debugging Infrastructure
6 open capi_meetup_in_japan_final
Bare metal performance in Elixir
Ein Stall voller Trüffelschweine - (PHP-)Profiling-Tools im Überblick
L.A.M.P Installation Note --- CentOS 6.5
4. open mano set up and usage
Thrift+scribe实现分布式日志收集,并与log4j集成
PRoot improved kernel compatibility
eBPF maps 101
from Binary to Binary: How Qemu Works
Secure PHP environment
20111011 bigbluebutton
USENIX Vault'19: Performance analysis in Linux storage stack with BPF
Ad

Similar to Introduction To Embedding The PH7 PHP Engine in a C/C++ Host Application. (20)

PDF
(phpconftw2012) PHP as a Middleware in Embedded Systems
PDF
HHVM on AArch64 - BUD17-400K1
ODP
PHP on Java (BarCamp London 7)
ODP
Php On Java (London Java Community Unconference)
PDF
PHP 7 new engine
PDF
olibc: Another C Library optimized for Embedded Linux
PDF
Retrospective: Seven VM Engineering Years
PPTX
Php 7.x 8.0 and hhvm and
PDF
Integrating PHP With System-i using Web Services
PDF
May2010 hex-core-opt
PDF
Php on Windows
PPTX
Steelcon 2014 - Process Injection with Python
PDF
PHP for Software Development
PDF
Multi-tasking in PHP
PPTX
Putting Compilers to Work
PDF
Dmitriy D1g1 Evdokimov - DBI Intro
PPTX
HipHop Virtual Machine
PPTX
PDF
Cloud Computing in Systems Programming Curriculum
PDF
PHP 7 performances from PHP 5
(phpconftw2012) PHP as a Middleware in Embedded Systems
HHVM on AArch64 - BUD17-400K1
PHP on Java (BarCamp London 7)
Php On Java (London Java Community Unconference)
PHP 7 new engine
olibc: Another C Library optimized for Embedded Linux
Retrospective: Seven VM Engineering Years
Php 7.x 8.0 and hhvm and
Integrating PHP With System-i using Web Services
May2010 hex-core-opt
Php on Windows
Steelcon 2014 - Process Injection with Python
PHP for Software Development
Multi-tasking in PHP
Putting Compilers to Work
Dmitriy D1g1 Evdokimov - DBI Intro
HipHop Virtual Machine
Cloud Computing in Systems Programming Curriculum
PHP 7 performances from PHP 5
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
DOCX
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Per capita expenditure prediction using model stacking based on satellite ima...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MIND Revenue Release Quarter 2 2025 Press Release
The AUB Centre for AI in Media Proposal.docx

Introduction To Embedding The PH7 PHP Engine in a C/C++ Host Application.

  • 1. PH7 Engine Introduction: http://ph7.symisc.net Introduction To Embedding PH7 PHP Engine in a C/C++ Host Application. November 08, 2012 http://ph7.symisc.net/ Author: Mrad Chems Eddine <chm@symisc.net> Copyright © Symisc Systems, SUARL
  • 2. PH7 Engine Introduction: http://ph7.symisc.net What is PH7 PH7 is a in-process software library that implements a highly-efficient embeddable bytecode compiler and a virtual machine for the PHP programming language. In other words, PH7 is a PHP engine which allow the host application to compile and execute PHP scripts in-process. PH7 is to PHP what SQLite is to SQL. PH7 implements most of the constructs introduced by the PHP 5.3 release such as heredoc, nowdoc, gotos, classes, anonymous functions, closures and so on and introduces very powerful extensions to the PHP programming language such as: • Function & Method Overloading. • Full Type Hinting. • Introducing comma expressions. • Introducing the eq and ne operators for strict string comparison. • Improved operators precedences. • Powerful OO subsystem. • Function arguments can take any complex expressions as their default values. • 64-bit integer arithmetic for all platforms. • Native UTF-8 support. • PH7 is 100% hand-coded, written in ANSI C, compile and run unmodified in any platform including restricted embedded devices with a C compiler. • Amalgamation: All C source code for PH7 are combined into a single source file. • Built with more 470 function including an XML parser (with namespace support), INI processor, CSV reader/writer, UTF-8 encoder/decoder, zip archive extractor, JSON encoder/decoder, random number/strings generator, native and efficient File IO for Windows and UNIX systems and many more without the need of any external library to link with. • PH7 is an Open-Source product. Refer to the feature page for a detailed description. PH7 is the ideal library for enhancing your application (i.e: SCM, Server, CMS, Control panel, Search engine, etc.) or device (i.e: router, set-top box, etc.) with dynamic web interfaces, with all benefits and power of the PHP(5) programming language without the overhead uncured by the insecure CGI mechanism and it's high costs such as process creation (fork(), exec()) since PH7 run in-process. As an embedded interpreter, it allows multiple interpreter states to coexist in the same program, without any interference between them. Programmatically, foreign functions in C can be added and values can be defined in the PHP environment. Being a quite small program, it is easy to comprehend, get to grips with, and use. PH7 is 100% hand-coded, written in ANSI C, compiles unmodified and should run in any platform including restricted embedded device with a C compiler. PH7 is extensively tested on Windows and UNIX systems especially Linux, FreeBSD, Oracle Solaris and Mac OS X. Copyright © Symisc Systems, SUARL
  • 3. PH7 Engine Introduction: http://ph7.symisc.net PH7 is a compact library. With all features enabled, the library size can be less than 600KiB, depending on compiler optimization settings. (Some compiler optimizations such as aggressive function inlining and loop unrolling can cause the object code to be much larger.) If optional features are omitted, the size of the PH7 library can be reduced below 220KiB. PH7 can also be made to run in very little heap (2MB), making PH7 a popular PHP engine choice on memory constrained gadgets such as cellphones, tablets, numeric devices and so on. PH7 is an open-source, dual-licensed product available free of charge for open-source projects under the term of the Symisc Public License (SPL) which is a GPL compatible license and is equivalent to the more popular Sleepycat license (An OSI approved license). See the licensing page for additional information. PH7 in 5 Minutes or Less Here is what you do to start experimenting with the PH7 engine without having to do a lot of tedious reading and configuration: download The Code Get a copy of the last public release of the PH7 engine. Visit the download page for more information. Write Programs That Use PH7 Below is a simple C program that demonstrates how to use the C/C++ interface to PH7. This program compile and execute the following PHP script. <?php echo 'Welcome guest'.PHP_EOL; echo 'Current system time is: '.date('Y-m-d H:i:s').PHP_EOL; echo 'and you are running '.php_uname(); ?> That is, this simple PHP script when running should display a greeting message, the current system time and the host operating system. A typical output of this program would look like this: Welcome guest Current system time is: 2012-09-14 10:08:44 and you are running Microsoft Windows 7 localhost 6.1 build 7600 x86 Here is the C code. Note that you can get a working version of this program here: Copyright © Symisc Systems, SUARL
  • 4. PH7 Engine Introduction: http://ph7.symisc.net 1. #include "ph7.h" 2. int main(void) 3. { 4. ph7 *pEngine; /* PH7 engine */ 5. ph7_vm *pVm; /* Compiled PHP program */ 6. int rc; 7. /* Allocate a new PH7 engine instance */ 8. rc = ph7_init(&pEngine); 9. if( rc != PH7_OK ){ 10. /* 11. * If the supplied memory subsystem is so sick that we are unable 12. * to allocate a tiny chunk of memory, there is no much we can do here. 13. */ 14. Fatal("Error while allocating a new PH7 engine instance"); 15. } 16. /* Compile the PHP test program defined above */ 17. rc = ph7_compile_v2( 18. pEngine, /* PH7 engine */ 19. PHP_PROG, /* PHP test program */ 20. -1 /* Compute input length automatically*/, 21. &pVm, /* OUT: Compiled PHP program */ 22. 0 /* IN: Compile flags */ 23. ); 24. if( rc != PH7_OK ){ 25. if( rc == PH7_COMPILE_ERR ){ 26. const char *zErrLog; 27. int nLen; 28. /* Extract error log */ 29. ph7_config(pEngine, 30. PH7_CONFIG_ERR_LOG, 31. &zErrLog, 32. &nLen 33. ); 34. if( nLen > 0 ){ 35. /* zErrLog is null terminated */ 36. puts(zErrLog); 37. } 38. } 39. /* Exit */ 40. Fatal("Compile error"); 41.} 42./* 43. * Now we have our script compiled, it's time to configure our VM. 44. * We will install an output consumer callback that redirect 45. * the VM output to STDOUT (download the C file to see the implementation). 46. */ 47.rc = ph7_vm_config(pVm, 48. PH7_VM_CONFIG_OUTPUT, 49. Output_Consumer, /* Output Consumer callback */ 50. 0 /* Callback private data */ 51. ); 52. if( rc != PH7_OK ){ 53. Fatal("Error while installing the VM output consumer callback"); 54. } Copyright © Symisc Systems, SUARL
  • 5. PH7 Engine Introduction: http://ph7.symisc.net 55./* 56.* And finally, execute our program. Note that your output (STDOUT in our case) 57.* should display the result. 58.*/ 59. ph7_vm_exec(pVm,0); 60./* All done, cleanup the mess left behind. 61.*/ 62. ph7_vm_release(pVm); 63. ph7_release(pEngine); 64.return 0; 65.} Download the C file. We create a new PH7 engine instance using a call to ph7_init() on line 8. This is often the first PH7 API call that an application makes and is a prerequisite in order to compile PHP code using one of the compile interfaces. We compile our PHP test program on line 17 using the ph7_compile_v2() interface. We configure our Virtual Machine on line 47 by setting a VM output consumer callback named Output_Consumer() (Download the C file to see the implementation). All this callback does is redirecting the VM output to STDOUT using the libc printf() routine or the write() system call. And finally we execute our PHP program on line 59 using a call to ph7_vm_exec(). You should see now the greeting message, the current date and the host operating system. Clean-up is done on line 62 and 63 respectively via calls to ph7_vm_release() and ph7_release(). Compile the program Compile this C file together with the PH7 engine source code to generate the executable. For example: gcc -W -Wall -O6 -o ph7_test ph7_intro.c ph7.c When running [./ph7_test ] you should see the greeting message, the current system time and the host operating system. Stand-alone Interpreter For PH7 The PH7 download page includes a simple stand-alone PHP interpreter named ph7 (or ph7.exe on windows) that allows the user to enter and execute PHP files against a PH7 engine. This utility is available in prebuilt binaries forms or can be compiled from source. You can get a copy of the PH7 interpreter from the download page. To start the ph7 program, just type "ph7" followed by the name of the PHP file to compile and execute. That is, the first argument is to the interpreter, the rest are scripts arguments, press "Enter" and the PHP code will be executed. If something goes wrong while processing the PHP script due to a compile-time error, your error output (STDOUT) should display the compile-time error messages. Usage example of the ph7 interpreter: Running the interpreter ph7 scripts/hello_world.php Copyright © Symisc Systems, SUARL
  • 6. PH7 Engine Introduction: http://ph7.symisc.net Running the interpreter with script arguments ph7 scripts/mp3_tag.php /usr/local/path/to/my_mp3s The PH7 interpreter package includes more than 70 PHP scripts to test ranging from simple hello world programs to XML processing, zip archive extracting, MP3 tag extracting, UUID generation, JSON encoding/decoding, INI processing, Base32 encoding/decoding and many more. These scripts are available in the scripts directory from the zip archive. Next Check out the Introduction To The PH7 C/C++ Interface for an introductory overview and roadmap to the dozens of PH7 interface functions. A separate document, The PH7 C/C++ Interface, provides detailed specifications for all of the various C/C++ APIs for PH7. Once the reader understands the basic principles of operation for PH7, that document should be used as a reference guide. Any questions, check the Frequently Asked Questions page or visit the Support Page for online community support. PH7 Engine Homepage: http://ph7.symisc.net/ Copyright © Symisc Systems, SUARL