|
|
 |
|
|
Overview of NuSphere PhpExpress
PHP files encoded with NuSphere Nu-Coder require special loader present in PHP interpreter. PhpExpress is NuSphere Free PHP loader and accelerator that provides support for encoded files and also speeds up the execution of regular PHP files.
PhpExress extensions for all operating systems can be found in the folder "loader" of your Nu-Coder installation.
PhpExpress can be downloaded from NuSphere website and distributed Free Of Charge without limitations in unmodified form. Every Nu-Coder installation also comes with PhpExpress. This is how PhpExpress works:
- When PHP interpreter executes any PHP script it first compiles the script into bytecodes. However Nu-Coder produces PHP files that have been already compiled into bytecodes.
- PhpExpress loads encoded PHP scripts directly into PHP engine saving time and boosting performance of PHP interpretor
- PhpExpress checks for license file if required - either via API call in the script to pelm_is_licensed() function (described later in this manual) or -licfile encoding option
- PhpExpress also implements caching for PHP engine and accelerates execution process even if PHP Script is not encoded
How to deploy NuSphere PhpExpress
NuSphere PhpExpress is a regular PHP extension, which makes it easy to install and deploy. To install PhpExpress:
- Open php.ini file for editing
- Add line
zend_extension_ts=c:\full\path\to\phpexpress-php-x.x.dll
if you are deploying on Windows, or
zend_extension=/full/path/to/phpexpress-php-x.x.so
if you are deploying on Unix, Linux or Mac OS operating systems
- Copy phpexpress-php-x.x.dll or phpexpress-php-x.x.so in the PHP extensions directory specified in php.ini file
- Stop and Start Apache if you are running PHP as Apache module
- Execute call to phpinfo() function and make sure that PhpExpress is properly installed
Once PhpExpress is installed on the server, you can execute PHP Scripts encoded with Nu-Coder as well as regular, not encoded PHP scripts. In both cases you will gain an improved performance in the execution of the scripts.
How to use API provided by NuSphere PhpExpress to work with Nu-Coder
PhpExpress provides a number of PHP Functions useful when encoding PHP files with and without Nu-Coder's License Manager.
The following functions are likely to be used by the users deploying files encoded with PHP Enoder:
void phpexpress()
shows phpexpress info page.
array phpexpress_hostid();
returns the list of host IDs that identify server hardware.
Note: all host IDs are shown on the PhpExpress info page. It's recommended to use ALL host IDs that are found on the system. It will make license less sensitive to the hardware changes.
The following functions are likely to be used by PHP developers deploying their PHP applications encoded by Nu-Coder:
bool pelm_is_licensed();
returns true if caller script is protected with license
bool pelm_load_license(string filename);
loads license and returns true if file is found.
Note: if relative path name is specified, PhpExpress will use include_path php setting to find the file. For further details about include_path see php manual.
string pelm_license_filename()
returns license filename that is applied to the caller script. It returns false if no license is used.
string pelm_get_attribute(string attr_name);
reads attribute value from the license applied to the caller script. It returns false if no license is used.
pe_handle_error($errcode, $errmessage, $licfilename)
gets called if the license is not found, expired or not valid for any other reason.
Possible error codes are:
PE_ERR_NO_LIC - no licenses found
PE_ERR_NO_VALID_LIC - the license is found but it is not applicable for this application
PE_ERR_EXPIRED_LIC - license is expired
PE_ERR_HOST_MISMATCH_LIC - license doesn't match the host (by IP or HTTP host)
PE_ERR_HW_MISMATCH_LIC - license is generated for a different hostid
How to monitor PHP Cache implemented by NuSphere PhpExpress
PhpExpress accelerates execution of PHP scripts by caching them and avoiding unnecessary compilation. You can view and control PHP Cache created by PhpExpress with a single function call to the PHP function phpexpress() provided by PhpExpress PHP extension. phpexpress() produces the output similar to phpinfo() with the user Interface to administer PhpExpress cache. The output of phpexpress() is illustrated here:
Please note that PHP caching is only enabled when PHP is running as an extension of the Web Server - dll on windows or shared object on Linux/Unix/Mac Operating Systems. Caching of PHP scripts when PHP is running in CGI mode is not useful and therefore disabled.
|
 |

click to enlarge
|
|
|
|  |
|