<title>Monkeybread Software - MBS FileMaker Plugin: PHP.Init</title></head><body>PHP.Init
--------

Initializes PHP.

<style>
td.grau 
{
background-color:#EEE;
text-align: center;
}
</style>| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PHP](component_PHP.md) | [2.9](newinversion29.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "PHP.Init" ) ### 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](PHPLoad.md).  
  
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](EnvironmentVariablesSetValue.md)"; "PHPRC"; "C:\\Users\\Christian\\Desktop\\php-5.6.12-Win32-VC11-x64\\\\")  
### Examples

Init PHP on Windows:

Set Variable \[$r; Value:MBS( "[EnvironmentVariables.SetValue](EnvironmentVariablesSetValue.md)"; "PHPRC"; "C:\\Users\\Christian\\Desktop\\php-5.6.12-Win32-VC11-x64\\\\")\]  
Set Variable \[$result; Value:MBS("[PHP.Load](PHPLoad.md)"; "C:\\Users\\Christian\\Desktop\\php-5.6.12-Win32-VC11-x64\\php5ts.dll")\]  
If \[$result &lt;&gt; "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

- [EnvironmentVariables.SetValue](EnvironmentVariablesSetValue.md)
- [PHP.Load](PHPLoad.md)
- [PHP.ShutDown](PHPShutDown.md)

### Example Databases

- [PHP/Simple\_php](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/PHP/Simple_php.shtml#2ScriptAnchor_)

### Blog Entries

- [PHP Functions in MBS Filemaker Plugin](https://www.mbsplugins.de/archive/2012-10-21/PHP_Functions_in_MBS_Filemaker/monkeybreadsoftware_blog_filemaker)

This function checks for a paid license.

Created 18th August 2014 , last changed 23th January 2023

  
[PHP.GetVariable](PHPGetVariable.md) - [PHP.IsInitialized](PHPIsInitialized.md)

💬 [Ask a question or report a problem](https://www.monkeybreadsoftware.com/feedback/?what=filemaker&path=PHP.Init)

[HTML Version](PHPInit.shtml)