Summary
In this article, we will explain how to create a PHP executor with the SQLSRV module installed and available for use when creating new scripts.
Prerequisites:
To implement this solution, the following items are required:
- Administrative access to ProcessMaker.
- Docker command for the executor (provided in this article).
Solution:
- Log on to ProcessMaker and click on the Admin option from the top menu.
- From the menu on the left, select Script Executor.
- Click on the +Script Executor button.
- In the Add New Script Executor window, enter a name for the executor and select the language as PHP.
- Enter the following code in the Docker file section.
ENV ACCEPT_EULA=Y
# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install apt-utils libxml2-dev gnupg apt-transport-https \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install curl and git
RUN apt-get update \
&& apt-get -y install git curl\
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install MS ODBC Driver for SQL Server
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& apt-get -y --no-install-recommends install msodbcsql unixodbc-dev mssql-tools\
&& pecl install pdo_sqlsrv-5.8.1 \
&& pecl install sqlsrv-5.8.1 \
&& echo "extension=pdo_sqlsrv.so" >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \
&& echo "extension=sqlsrv.so" >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-sqlsrv.ini \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Check installation
RUN php -m - Click the Save and Build button to save your changes.
- A message displays confirming the completion of this procedure. Click the Close button to close this window.
- The PHP with SQLSRV executor is now available in the list of languages when creating a new script.