Welcome to our detailed guide on installing PHP on a Windows server for use with FileMaker Server 2023. With the evolving technology and server management strategies, Claris has shifted away from bundling PHP with FileMaker Server installations. This change requires administrators to undertake manual installation and configuration of PHP to enable Custom Web Publishing (CWP) with PHP. This post will walk you through the necessary steps to ensure a successful setup on a Windows environment.

Understanding the Shift

Historically, FileMaker Server came with PHP pre-installed, which streamlined the process of setting up web publishing capabilities. The installation was part of the FileMaker Server Deployment Wizard, which handled configuration details automatically, including registry settings, web server adjustments, and file placements.

As of FileMaker Server 19.2, and continuing with the latest 2023 version, PHP is no longer included in the installation package for both Windows and macOS platforms. This change means that administrators need to manually install and configure PHP to maintain the functionality of their custom web applications.

1. Preparing for PHP Installation on Windows

Before diving into the PHP installation process, ensure that your system meets the following prerequisites:

  1. Windows Server 2022: Ensure that your server is updated to the latest service packs and security updates.
  2. Administrative Rights: You will need administrative access to install software and make configuration changes on the server.
  3. FileMaker Server 2023 Installed: PHP installation and configuration should be done post the installation of FileMaker Server to avoid any conflicts.
  4. Internet Information Services (IIS): IIS should be installed and running on your Windows server as PHP will need to be integrated with it for web publishing.

Step 2: Download and Install Prerequisites

  • Microsoft Visual C++ Redistributable: Install the Microsoft Visual C++ Redistributable for Visual Studio 2022 if it’s not already installed. Download here.

Step 3: Install PHP

3.1 Stop any existing PHP processes

Open the command prompt as Administrator and execute:

cmd
TASKKILL /IM php-cgi.exe /F

3.2 Stop the FileMaker Server to prevent conflicts during the PHP setup

cmd
net stop "FileMaker Server"

3.3 Prepare the PHP installation directory

Navigate to the FileMaker Server’s publishing engine directory:

cmd
cd "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine"

Download the specific PHP version recommended by Claris:

cmd
start /wait powershell Start-BitsTransfer -Source https://windows.php.net/downloads/releases/archives/php-7.4.9-nts-Win32-vc15-x64.zip -Destination php.zip

Extract the downloaded zip file:

cmd
start /wait powershell Expand-Archive -Path "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php.zip" -DestinationPath php

3.4 Configure PHP

Navigate to the extracted PHP directory:

cmd
cd "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php"

Create a new php.ini file from the production template:

cmd
copy php.ini-production php.ini

Modify the php.ini to include necessary configurations:

cmd
echo default_charset = "utf-8" >> php.ini
echo include_path = ".;C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php\PEAR;C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php\FileMaker;C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php" >> php.ini
echo curl.cainfo = "C:\Program Files\FileMaker\FileMaker Server\CStore\root.pem" >> php.ini
echo extension_dir = "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php\ext" >> php.ini
echo enable_dl = On >> php.ini
echo extension = php_curl.dll >> php.ini

Add the PHP directory to the system path:

cmd
setx /M path "%PATH%;C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php;"

Step 4: Install FileMaker API for PHP and PHP PEAR Package

4.1 Download and extract the FileMaker API for PHP

cmd
start /wait powershell Expand-Archive -Path "FM_API_for_PHP_Standalone.zip" -DestinationPath "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php"

4.2 Install PHP PEAR

Navigate back to the PHP installation directory and download the PEAR package installer:

cmd
start /wait powershell Start-BitsTransfer -Source https://pear.php.net/go-pear.phar -Destination go-pear.phar

Run the installer:

cmd
php go-pear.phar

Follow the on-screen instructions to complete the setup, choosing ‘system’ installation when prompted.

Step 5: Restart and Verify Installation

Restart the FileMaker Server to apply changes and re-enable the web publishing services:

cmd
net stop "FileMaker Server"
net start "FileMaker Server"
fmsadmin SET CWPCONFIG ENABLEPHP=true

Step 6: Testing

After completing the installation, test the PHP setup by navigating to a PHP info page hosted on your server, or use the provided FileMaker PHP test script to ensure everything is functioning correctly.

This detailed guide ensures that PHP is installed and configured correctly on your Windows server for use with FileMaker Server 2023, allowing for robust custom web publishing capabilities.