Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#815702
I have two following questions:
Q#1: Does ProcessMaker support 3rd party dynamic extensions or just provide only an option to enable/disable it from php.ini file?
Q#2: If ProcessMaker provides a framework or mechanism to create and load custom dynamic extensions then how can i create a one for myself? Any tutorial available?

Problem Statement:
I have written a dynamic extension (.so file; platform is CentOS 7) in C++ using PHP-CPP-LEGACY framework, this dynamic extension works fine with the PHP 5.4.16 and Zend Engine v2.4.0 (seperately installed on my dev machine), i want to load it in the ProcessMaker to use this extension in my custom developed plugin, but unfortunately its not being loaded into the phpinfo() output. I performed following steps:
1. I copied the output file into the ProcessMaker's extensions directory using following command "cp -f myExtension.so /home/mkhan/processmaker-3.2.1-0/php/lib/php/extensions"
2. Used following command to copy its ini file into the etc directory "cp -f myExtension.ini /home/mkhan/processmaker-3.2.1-0/php/etc", furthermore I also entered the name of my extension in the php.ini file after extension property.
3. Restarted Apache Web Server using Bitnami Server Manager (manager-linux-x64.run)
4. Load <?php phpinfo(); ?> from the info.php file (https://192.168.56.111:8443/plugin/cust ... n/info.php)
5. check the name of my dynamic extension in the output page

I didn't find my extension in the output after lot of tries and combinations, please help me by suggesting a way to develop custom dynamic extension for ProcessMaker as I didn't find any on your site or in the google search.
#815703
Make sure that your /home/mkhan/processmaker-3.2.1-0/php/lib/php/extensions/myExtension.so file is readable by the "daemon" user (or set its file permissions to 777 just to make sure).

Turn on startup errors. In your /opt/mkhan/processmaker-3.2.1-0/php/etc/php.ini file, set:
Code: Select all
display_errors = On
display_startup_errors = On
error_reporting = E_ALL
extension=/home/mkhan/processmaker-3.2.1-0/php/lib/php/extensions/myExtension.so
Then restart Bitnami Apache (or reboot).
Then use this command to see if the extension has loaded and whether there were any errors:
cd /opt/mkhan/processmaker-3.2.1-0/php/bin
./php -v
./php -m
./php -a
This last command should show if there are any startup errors. Press Ctrl+D to exit.

There are some changes between PHP 5.4 and 5.6. Are you sure that your code is compatible with PHP 5.6 (which is what is needed by PM 3.2.2 and later?
#815721
Thanks for the detailed and prompt reply.

I followed your instructions and got the following warnings (by executing ./php -v command) as output.

PHP Warning: PHP Startup: myExtension: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0


Which API it is talking about? and what should I do next to match both compilations?

I am testing this dynamic extension with a simple out statement to print "Hello World" string, I have not added any custom functionality or checked its compatibility features yet, but thanks I will consider them when time will come for the real implementation.
#815729
Your extension has to be compiled for the version of PHP installed on your ProcessMaker server.

You need to install the php5.6-devel package if using CentOS/Red Hat or php5.6-dev if using Ubuntu/Debian. Then use phpize when compiling your extension:
Code: Select all
$ cd extensioname
$ phpize
$ ./configure
$ make
# make install 
See:
http://php.net/manual/en/install.pecl.phpize.php
https://stackoverflow.com/questions/310 ... run-phpize

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]