Beruflich Dokumente
Kultur Dokumente
From ProcessMaker
ProcessMaker uses Propel library to map between ProcessMaker's PHP classes and
databases. Propel allows access to different DBMS, including MySql, Microsoft SQL
Server, PostgreSQL, and Oracle.
The ProcessMaker automatically detects which database modules for PHP are installed on
the server. For example if the php-pgsql module is installed on the ProcessMaker server,
ProcessMaker will offer the option to connect to PostgreSQL databases.
Contents
[hide]
Engine: Select the type of database, which can be MySql, PostgreSQL, Microsoft
SQL Server, or Oracle. ProcessMaker will only offer databases in the dropdown list
which have PHP modules installed on your server.
If MySQL or PosgreSQL is selected in ProcessMaker version 1.2-2425 and later, the option
Encode will appear below Engine to allow the character encoding of the database to be
selected. Look up the encoding of your external database.
Port: The port used by the external database. If this field is left empty, the routine
will use the default port, which is 3306 for MySQL, 5432 for PostgreSQL, 1521 for
Oracle, and 1433 for SQL Server.
Once you have filled out this information, you need to test the connection by clicking on
the Test Connection button. The test routine verifies hostname, port, service, the user
access, and the existence of the database, as shown in this illustration:
If the test is successful, then click Create to set up the connection. After that the database
connection will be available for the current process. It can be used in SQL SELECT
statements in DynaForms fields and with the executeQuery() function in triggers.
MySQL
All the necessary modules should already be installed in order to use an external MySQL
database, since those same modules are needed to use the internal databases used by
ProcessMaker.
By default MySQL servers are set up to only receive local connections from the localhost.
If ProcessMaker is trying to connect to a a MySQL server on another machine, then that
server will have to be configured to allow external connections. Edit the my.cnf file of the
MySQL server and comment out the line:
# bind-address = 127.0.0.1
Then reload or restart the MySQL server. To check whether MySQL is listening for
external connections, in Windows issue the command:
netstat -an
netstat -tanp
mysql -u root -p
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| example_db |
+--------------------+
3 rows in set (0.00 sec)
Look for the "client characterset" which is the character set in which ProcessMaker
will send queries to the MySQL database and the "Conn. characterset" which is the
character set which MySQL will send information back to ProcessMaker.
character_set_client = <character-set>
character_set_results = <character-set>
character_set_connection = <character-set>
If detailed records need to be kept about each action in the MySQL databases used by
ProcessMaker, turn on the debug logging.
/opt/processmaker/workflow/public_html/sysGeneric.php
c:\Program
Files\ProcessMaker\apps\processmaker\workflow\public_html\sysGeneric.php
Change the value of the debug setting to 1 to turn on detailed SQL logging:
'debug' => 1, //change this value to 1, to have a detailed sql log in
PATH_DATA . 'log' . PATH_SEP . 'workflow.log'
This line will enable logging to three log files in the path: <INSTALL-
DIRECTORY>shared/log/
rbac.log
report.log
workflow.log
PostgreSQL
In order for ProcessMaker to connect to a PostgreSQL database, the PostgreSQL client
software and the PHP module "pgsql" has to be installed on the same machine as the
ProcessMaker server.
Windows
Download the pgInstaller for Windows and install the PostgreSQL client software (and the
server as well if you plan on running PostgreSQL server from the same machine as the
ProcessMaker server).
Then go to the directory where you installed PHP and verify that you have the dynamic link
libraries php_pgsql.dll and php_pdo_pgsql.dll located in the ext directory. If you
used the ProcessMaker Windows Installer, these files can be found at: C:\Program
Files\ProcessMaker\php\ext\
Then enable PHP's PostgreSQL modules, by opening the PHP configuration file php.ini
with a plain text editor. If you used the ProcessMaker Windows Installer, it will be located
at: C:\Program Files\ProcessMaker\php\php.ini
Look for the "Windows Extensions" section and uncomment the PostgreSQL modules by
removing the semicolon (;) from the beginning of following lines:
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
Then restart the Apache server to use the new PHP configuration, by going to the command
line (located at Start > All Programs > Accessories > Command Prompt) and issuing the
command:
httpd -k restart
To verify that PHP is now using the PostgreSQL modules, create a file named "info.php"
with a bare text editor containing:
<?php
phpinfo();
?>
and save it to your workflow\public_html\ directory, which generally will be found at:
C:\Program
Files\ProcessMaker\apps\processmaker\htdocs\workflow\public_html\
Then open your web browser and direct it to http://localhost/info.php and you
should see the configuration information about PHP. Verify that the pdo_pgsql and pgsql
modules are enabled.
The next time you open ProcessMaker and go to the ADMIN > DATABASE
CONNECTIONS and click "New", PostgreSQL should be an available option under
Engine.
GNU/Linux or UNIX
It is best to install the PostgreSQL client and PostgreSQL's PHP module using the
repositories of your distribution. In Red Hat/Cent OS/Fedora, login as root and issue the
command:
In Debian and its derivatives, login as root and issue the commands:
In Ubuntu:
Then verify that the pgsql and pdo_pgsql modules are enabled with the command:
php -m
The next time you open ProcessMaker and go to the ADMIN > DATABASE
CONNECTIONS and click on New, PostgreSQL should be an available option under
Engine.
Windows
Make sure that the version of ntwdblib.dll matches the version of SQL Server. For
instance, the dynamic link library for SQL Server 2003 will not work to connect to SQL
Server 2005.
Then edit the php.ini file that is in the directory C:\Program Files\ProcessMaker\php, to
enable the mssql extension:
extension=msql.dll
After restarting Apache (or rebooting the server), the option "SQL Server" should appear as
an available option under the Engine dropdown box for Database Connections.
GNU/Linux or UNIX
ProcessMaker servers running on GNU/Linux or UNIX can access Microsoft SQL Server
or Sybase databases by installing FreeTDS. Most distributions provide a PHP extension
package for SQL Server or Sybase, which contains FreeTDS. If your distribution doesn't
provide a package for FreeTDS, see these instructions to compile FreeTDS from the source
code.
Red Hat/CentOS/Fedora
extension=mssql.so
/etc/init.d/httpd restart
Debian/Ubuntu
In Debian login as root and install the php5-sybase package (which will work for MS SQL
Server as well):
If planning on executing stored procedures on the SQL Server database, edit the FreeTDS
configuration file, which in Debian/Ubuntu is found at /etc/freetds/freetds.conf. Edit
the following lines to specify the IP address and port of server where SQL Server is
installed and the FreeTDS version number:
host = xxx.xxx.xxx.xxx
port = 1433
tds version = 8.0
Oracle
In order to connect to an Oracle database, Oracle's client software must be installed on the
same server running ProcessMaker.
Windows
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
Install the version of InstantClient which corresponds to your version of Oracle Server.
From version 1.1-2151 on, the ProcessMaker Windows Installer has the PHP extensions
already enabled to connect to Oracle servers. In previous versions of ProcessMaker, the
PHP extensions for Oracle need to be enabled by editing the php.ini file. These extensions
are the following:
;extension=php_oci8.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
To enable these extensions, just delete the semicolon (;) which is found at the beginning of
each line.
After installing the InstantClient and modifying php.ini, Windows must be restarted to
enable the InstantClient. Then, "Oracle" should appear as one of the available options when
creating a Database Connection.
GNU/Linux
Oracle provides official rpm packages to install its InstantClient in 32-bit Red Hat/CentOS,
which can be downloaded for free at:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.h
tml
For ProcessMaker servers using 64bits or a different server, download the ZIP file of
InstantClient.
http://www.oracle.com/technology/tech/linux/install/index.html
If installing InstantClient in Red Hat, Fedora or SuSE, the links in this page may be helpful.
Oracle also provides a repository for Debian (and Ubuntu), which can be accessed by
adding the following line to the file /etc/apt/sources.list:
See these instructions or this blog article to enable the repository and install InstantClient.