Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3   10.4    Statistic  

PHP.Init

Initializes PHP.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
PHP 2.9 Yes Yes Yes Yes No
MBS( "PHP.Init" )   More

Parameters

none

Result

Returns Ok on success.

Description

Initializes PHP.
This must be called at least once before you execute any PHP code. You must call this after PHP.Load.

May work on server. Be sure to use right bit number to match server, not client!

Windows error 193 means that 64-bit FileMaker tried to load 32-bit library or 32-bit FileMaker tried to load 64-bit library. The bit level must match between app and library. For macOS the error message will tell you about wrong architecture.

You can set PHP runtime configuration path via shell variable on Windows, e.g. like this:
MBS( "EnvironmentVariables.SetValue"; "PHPRC"; "C:\Users\Christian\Desktop\php-5.6.12-Win32-VC11-x64\\")

Examples

Init PHP on Windows:

Set Variable [$r; Value:MBS( "EnvironmentVariables.SetValue"; "PHPRC"; "C:\Users\Christian\Desktop\php-5.6.12-Win32-VC11-x64\\")]
Set Variable [$result; Value:MBS("PHP.Load"; "C:\Users\Christian\Desktop\php-5.6.12-Win32-VC11-x64\php5ts.dll")]
If [$result <> "OK"]
    Show Custom Dialog ["php DLL was not found!"; "Please enter the path the php DLL in the field provided and try again."]
    Exit Script []
End If
Set Variable [$result; Value:MBS("PHP.Init")]
If [$result = "OK"]
    Show Custom Dialog ["Success!"; "php is ready to go."]
Else
    Show Custom Dialog ["Error!"; "php couldn't be started"]
End If

See also

Example Databases

Blog Entries

Created 18th August 2014, last changed 10th August 2020


PHP.GetVariable   -   PHP.IsInitialized

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins