Page 1 of 2

ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Mon Dec 05, 2016 12:00 pm
by awasie
ProcessMaker Version : 3.1.2-community
PHP Version : 5.6.27

In this article for connecting Microsoft SQL Server:
http://wiki.processmaker.com/3.0/Database_Connections

we have to download freetds dll, I cannot find dll for php 5.6.x

i use PHP 5.5.x but getting the following error in php error log.

05-Dec-2016 15:25:46 UTC] PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match

how can i connect to MSSQL how can i connect to MSSQL or what is the solution? - please help

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Mon Dec 05, 2016 8:35 pm
by amosbatto
Are you using freedts on Linux? You need to downgrade to PHP 5.5.X, since freetds isn't compatible with PHP 5.6.X.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Tue Dec 06, 2016 2:26 am
by awasie
I am using prcoessmaker on windows 7 64-bit. I have some point need to be clear i am new in processmaker.

1 - how can i downgarde from php 5.6.x to 5.5.x. I install processmaker 3.1 community edition ( Bitnami installer )
2 - can i downlaod processmaker 3.0 community edition is it using php 5.5.x?
3 - we have choice other than freetds for processmaker?

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Dec 07, 2016 12:14 am
by amosbatto
I found some freetds.dll files for php 5.6, which might work:
Non-thread safe:
https://moodle.org/pluginfile.php/133/m ... lib%29.zip
Thread safe:
https://moodle.org/pluginfile.php/133/m ... lib%29.zip
See:
https://moodle.org/mod/forum/discuss.php?d=232844

Haven't had a chance to test them, but see if they work.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Dec 07, 2016 4:30 am
by awasie
Thanks for posting lib but these are compiled with 32-bit.

Should i go for ProcessMaker 3.0?

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Thu Dec 08, 2016 12:50 am
by amosbatto
Yes, an older version of PM which uses PHP 5.5 is probably the best solution until there is a freetds for php 5.6.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Thu Dec 08, 2016 3:49 am
by awasie
Yes, i uninstall processsMaker 3.1 and install processMaker 3.0 CE now it work.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Sat Jun 10, 2017 4:46 am
by newways3000
Hi
I install bitnami installer for processmaker 3.2 and put dll file consists in
(182.76 KiB) Downloaded 215 times
into php\ext and then modify php.ini as moodle documents says. Now in admin->PHP information section mssql part appeares and in Designer->Database Connections SqlServer appers and tests succesfully. But When I go to form designer and set a query to a DropDown in preview and in case this Message Appears "An internal error occurred #1497083694. Please contact your system administrator for more information." . The query that i put in sql field is valid and has run in Navicat succesfully.
I ran a custom php code : php.exe test.php file contains :
Code: Select all
$link = mssql_connect('127.0.0.1', 'userName', 'Password' ); //real passwords in this part put
if (!$link) { die('Something went wrong while connecting to MSSQL');} else {	die("succesfull!"); }
it responds 'Unable to connect to server'
It seems there is a problem with dll file.

Then as forums geeks says, I install processmaker 3.2 on wamp 2.5 (php 5.5) and put
(132.1 KiB) Downloaded 126 times
into php\ext and then modify php.ini as moodle documents says. Now in admin->PHP information, mssql section does NOT even exist and therefore sqlserver does not appeare in DataBase Connections !
Even I use some other Builts of freeTDS for php 5.5 such as
(115.63 KiB) Downloaded 128 times
and nts versions of all but nothing changed!
:oops:
Any Idea Folks?

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Jun 14, 2017 12:31 am
by amosbatto
People say that it is possible to compile freetds to work with PHP 5.6, but I couldn't get it to work. The solution for now is to do a manual install with PHP 5.5.

Re: ProcessMaker 3.2, php 5.6 connection to MSSQL

Posted: Tue Jul 04, 2017 6:27 am
by newways3000
I solved the issue in this way (for processmaker 3.2 php 5.6 using bitnami installer)

1. Put files
(444.5 KiB) Downloaded 344 times
and
(159.5 KiB) Downloaded 293 times
and
(145.5 KiB) Downloaded 300 times
in {php installed directory}/php/ext

2. Add this three lines to end of your php.ini (placed in {php installed directory}/php/ )
Code: Select all
extension=php_dblib.dll
extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll
3. Extract file
(14.96 KiB) Downloaded 271 times
(use Extract Here in WinRar) to this location : {processmaker installed path}\apps\processmaker\htdocs\gulliver\thirdparty\creole\drivers (the folder named "mssqlsrv" must placed in mentioned folder )

4. Edit Creole.php (located in {processmaker installed path}\apps\processmaker\htdocs\gulliver\thirdparty\creole\ ) : line 88 :
Code: Select all
 'mssql' => 'creole.drivers.mssql.MSSQLConnection', 
to
Code: Select all
 'mssql' => 'creole.drivers.mssqlsrv.MSSQLSRVConnection', 
or simply replace Creole.php with file in zipped file
(6.15 KiB) Downloaded 185 times
Now it worked (at least for me!)
Actually with creole sqlsrv driver, we get rid of all mssql garbages that deprecated from php

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Tue Jul 04, 2017 6:01 pm
by amosbatto
Fantastic work newways3000. Thanks for taking the time to figure this out. I gave up trying to solve it.

Out of curiosity, where did you get the files? I am filing an internal bug report about this for the developers and I need to know where they can get the code.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Jul 05, 2017 5:45 am
by newways3000
You'r welcome !
We always owe to "open source" !
The dll files was at related wiki page of processmaker 3 for connect it to sql server.
Actually I found the driver in processmaker 2.5 . Appearently it removed from 3 because it had some bugs.
The bugs was in MSSQLSRVConnection.php , class MSSQLSRVConnection , method connect .
I changed line
Code: Select all
$serverName = $serverName . ',' . $serverPort;
to
Code: Select all
$serverName = $serverName . ', ' . $serverPort;
You can Believe it or not but sqlsrv_connect can not connect to database with ',' between $serverName and $serverPort ! It must be ', ' :roll:

Another Bug was at same connect method where you specify encoding of $connectionInfo
Code: Select all
if(array_key_exists('encoding', $dsninfo)){
			if($dsninfo['encoding'] == 'utf8'){
				$connectionInfo['CharacterSet'] = 'UTF-8';
			}
			$connectionInfo['CharacterSet'] = $dsninfo['encoding'];
		}
As you see $dsninfo['encoding'] 's value will put in 'CharacterSet' key of $connectionInfo (no matter what $dsninfo['encoding'] is !)
If it is 'utf8' $connectionInfo['CharacterSet'] must be 'UTF-8' not else. If not sqlsrv_connect will fail to connect.
So I changed that to
Code: Select all
if(array_key_exists('encoding', $dsninfo)){
			if($dsninfo['encoding'] == 'utf8'){
				$connectionInfo['CharacterSet'] = 'UTF-8';
			}
			else
			{
				$connectionInfo['CharacterSet'] = $dsninfo['encoding'];
			}
		}
Finally you must force creole extension to use SQL Server driver for managing sql connections not mssql .
Locate file creole in creole folder that exist in parent folder of drivers. Creole.php , class creole where you specify the $driverMap .


If this helped you I appreciate if you vote up my answer at stackoverflow :wink: :wink:

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Thu Jul 06, 2017 12:01 am
by amosbatto
Wow, I'm impressed you figured it out. I'll pass this to the developers to see if we can get it incorporated into future versions of PM.
Internal bug report: https://processmaker.atlassian.net/browse/TRI-2771

Re: ProcessMaker 3.2, php 5.6 connection to MSSQL

Posted: Mon Jul 10, 2017 10:33 am
by bilalk
hi newways3000,

i did what you told here. It didnt work for me. did you do anything except them?

or someone tried this method?

i did with manual installation but bitnami installer is better. can you check it please?
newways3000 wrote:I solved the issue in this way (for processmaker 3.2 php 5.6 using bitnami installer)

1. Put files
php_dblib.dll
and
php_sqlsrv_56_ts.dll
and
php_pdo_sqlsrv_56_ts.dll
in {php installed directory}/php/ext

2. Add this three lines to end of your php.ini (placed in {php installed directory}/php/ )
Code: Select all
extension=php_dblib.dll
extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll
3. Extract file
creoleSqlServerDriver.rar
(use Extract Here in WinRar) to this location : {processmaker installed path}\apps\processmaker\htdocs\gulliver\thirdparty\creole\drivers (the folder named "mssqlsrv" must placed in mentioned folder )

4. Edit Creole.php (located in {processmaker installed path}\apps\processmaker\htdocs\gulliver\thirdparty\creole\ ) : line 88 :
Code: Select all
 'mssql' => 'creole.drivers.mssql.MSSQLConnection', 
to
Code: Select all
 'mssql' => 'creole.drivers.mssqlsrv.MSSQLSRVConnection', 
or simply replace Creole.php with file in zipped file
Creole.rar
Now it worked (at least for me!)
Actually with creole sqlsrv driver, we get rid of all mssql garbages that deprecated from php

Re: ProcessMaker 3.2, php 5.6 connection to MSSQL

Posted: Sat Jul 15, 2017 6:15 am
by newways3000
bilalk wrote:hi newways3000,

i did what you told here. It didnt work for me. did you do anything except them?

or someone tried this method?

i did with manual installation but bitnami installer is better. can you check it please?
Hi

Can you tell what exactly you do and what exactly you get from machine? Explain with machin responses , browser outputs , screenshots or else.

Take this tips into consideration:
    [*]Do EXACT Steps mentioned in [url=http://wiki.processmaker.com/3.0/Database_Connections]Processmaker guide[/url]
    [*]If you do that , you will be able to create a connection to database in Database Connections successfully. If not so you must figure that out first.
    [*] The actual problem is in processmaker driver for minipulating data. If you connect to database succesfully but cant -for example- fill a dropdown with sql server datasources then you must use presented driver in my answer.

Re: ProcessMaker 3.2, php 5.6 connection to MSSQL

Posted: Wed Jul 19, 2017 3:33 am
by bilalk
newways3000 wrote:
bilalk wrote:hi newways3000,

i did what you told here. It didnt work for me. did you do anything except them?

or someone tried this method?

i did with manual installation but bitnami installer is better. can you check it please?
Hi

Can you tell what exactly you do and what exactly you get from machine? Explain with machin responses , browser outputs , screenshots or else.

Take this tips into consideration:
    [*]Do EXACT Steps mentioned in [url=http://wiki.processmaker.com/3.0/Database_Connections]Processmaker guide[/url]
    [*]If you do that , you will be able to create a connection to database in Database Connections successfully. If not so you must figure that out first.
    [*] The actual problem is in processmaker driver for minipulating data. If you connect to database succesfully but cant -for example- fill a dropdown with sql server datasources then you must use presented driver in my answer.
hi newways3000,

i did exactly same as wiki its not working there is no MSSQL database connection. After that i did your method, it didnt work. machine reponses like i didnt do anything.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Mon Aug 14, 2017 1:31 pm
by newways3000
Hi Bilal Kymaz

I tried that and it worked nice.
But in case you coudn't run that, plus being sure you did all above stuff, try this
Consider your php folder is at "D:/Bitnami/processmaker-3.2-0/php/"
change php.ini line 732 from
Code: Select all
extension_dir = "D:/Bitnami/processmaker-3.2-0/php/ext"
to
Code: Select all
extension_dir = "D:\Bitnami\processmaker-3.2-0\php\ext"
It means you must replace all "/" with "\"


and then restart all services

I appreciate inform me if that resolved issue 8)

Re: ProcessMaker 3.2, php 5.6 connection to MSSQL

Posted: Tue Nov 21, 2017 7:21 am
by erpnedir
Hi newways3000,
I face the same problem. I did a manual PM 3.2 install on Win Server 2012 R2, see the MsSQL at DB connection, pass the test and see the disappointing message the exact steps you mention: 'An internal error occurred #1511262315. Please contact your system administrator for more information.'
I also checked that my slashes ar backslash at php.ini, extension_dir. And still getting the same.
I noticed that Apache error log notes below two lines. Do you have any idea?
Code: Select all
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_sqlsrv_56_ts.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_pdo_sqlsrv_56_ts.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
newways3000 wrote:
bilalk wrote:hi newways3000,

i did what you told here. It didnt work for me. did you do anything except them?

or someone tried this method?

i did with manual installation but bitnami installer is better. can you check it please?
Hi

Can you tell what exactly you do and what exactly you get from machine? Explain with machin responses , browser outputs , screenshots or else.

Take this tips into consideration:
    [*]Do EXACT Steps mentioned in [url=http://wiki.processmaker.com/3.0/Database_Connections]Processmaker guide[/url]
    [*]If you do that , you will be able to create a connection to database in Database Connections successfully. If not so you must figure that out first.
    [*] The actual problem is in processmaker driver for minipulating data. If you connect to database succesfully but cant -for example- fill a dropdown with sql server datasources then you must use presented driver in my answer.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Tue Nov 21, 2017 7:52 pm
by amosbatto
erpnedir wrote:Hi newways3000,
I face the same problem. I did a manual PM 3.2 install on Win Server 2012 R2, see the MsSQL at DB connection, pass the test and see the disappointing message the exact steps you mention: 'An internal error occurred #1511262315. Please contact your system administrator for more information.'
I also checked that my slashes ar backslash at php.ini, extension_dir. And still getting the same.
I noticed that Apache error log notes below two lines. Do you have any idea?
Code: Select all
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_sqlsrv_56_ts.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_pdo_sqlsrv_56_ts.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
Faith, The problem might be that you need to use all 32 bit applications. See:
https://stackoverflow.com/questions/225 ... pplication

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Nov 22, 2017 9:28 pm
by erpnedir
Dear Amos, thank you for the quick reply.
I did a fresh setup with everything 32bit, get rid of the error message at Apache logs, but still not succeed.
It is disappointing not to achieve something I have done many times for previous versions.
I will keep posting as I progress.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Nov 22, 2017 11:28 pm
by amosbatto
Faith, Are you using PHP 5.5 32 bit? I recommend it, if you are going to connect to MS SQL Server.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Sat Nov 25, 2017 3:49 pm
by erpnedir
Dear Amos,
I am following newways3000s method. When I write a trigger to get the results from db, below is the error message:
No driver has been registered to handle connection type
Any idea how can I register Creole driver?

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Mon Nov 27, 2017 3:10 am
by erpnedir
Dear Amos,
I split the manual installation process into two parts. Before installing ProcessMaker, I could connect to remote Ms SQL Server and get data with a php script. This means the problem is at ProcessMaker part.
I guess that version 3.2.2 is about to release. Can you please notify the QA team to add a Ms SQL Server remote connection test scenario to their tests.
Thanks.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Mon Nov 27, 2017 9:15 pm
by amosbatto
Faith, Have you tried to install PHP 5.5? That is the recommended solution.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Tue Nov 28, 2017 5:48 pm
by erpnedir
Hi Amos,
I am experienced in this forum. I surely know that I must never underestimate the advice from Amos! :wink:
Yes of course I tried php 5.5 32 bit after your advice. I used both Windows Server 2012 R2 and Centos 7.2.
I tried all by 32 bit versions and all by 64 bit versions (Mysql, Apache 24, PHP 5.5).
I tried generic dll s that is listed on wiki and specific dlls for PHP versions from Microsoft.
I tried lot on the method newways3000 described.
As I stated in my previous post, I can get data with PHP natively. There is something going wrong on PM part, which also newways mentioned. The thing is, his method did not work on my installations. There must be something missing.
Do you have any idea about 3.2.2 release date? I will try with that version also.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Tue Nov 28, 2017 9:43 pm
by amosbatto
Faith, They supposedly have fixed the bug in version 3.2.2, but I don't have access to the new version to test it. Probably best to wait for the next release.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Wed Nov 29, 2017 12:52 pm
by erpnedir
At last I found what is missing!
If you want to connect to a remote Ms SQL Server, you need to install SQL Native Connection on your PM Server. Here is the link for Microsofts download page: https://www.microsoft.com/en-us/downloa ... x?id=29065
Do NOT hurry to click the DOWNLOAD button. Click on Install Instructions. Go down the page an find SQL Native Client appropriate for your SQL server version.
Download sqlncli.msi 32 bit or 64 bit, according to your OS.
For 64 bit http://go.microsoft.com/fwlink/?LinkID= ... lcid=0x409
For 32 bit http://go.microsoft.com/fwlink/?LinkID= ... lcid=0x409

I used Bitnami installer for ProcessMaker 3.2 for 32 bit (not the 64 bit)
Windows Server 2012 R2 Datacenter 64 bit OS
I did the exact directives as newways3000 described in this thead above.

On an alternative setup with Manual Installation (Not Bitnami), I solved the connectivity problem by installing msodbcsql:
https://www.microsoft.com/en-us/downloa ... x?id=36434

Hope this helps.

PS: Amos it would be nice if you mention SQL Native Client in wiki at Database Connection section for Windows.

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Sun Jul 22, 2018 7:38 am
by hmdshariati
if you want run a development area you can use virtualbox with shared folder.
but for production, one of my friends, changes the core of processmaker for correct utf-8 connection with mssql server on windows. to learn you should pay for that. send mail if you want ([email protected])

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Mon Feb 04, 2019 2:20 am
by YolandaYan
've got an old project that still runs 5.3.9 and has supported connection to SQL Server. I would like to develop some new features and for that I Imran Khan news
Nawaz Sharif news would appreciate start using the latest version of PHP. But for what I've read there is no support to SQL Server. Any guide that allows me to connect PHP to SQL server in version 5.6?

Re: ProcessMaker 3.1, php 5.6 connection to MSSQL

Posted: Tue Feb 05, 2019 10:20 pm
by amosbatto
YolandaYan wrote:I've got an old project that still runs 5.3.9 and has supported connection to SQL Server. I would like to develop some new features and for that I would appreciate start using the latest version of PHP. But for what I've read there is no support to SQL Server. Any guide that allows me to connect PHP to SQL server in version 5.6?
ProcessMaker now supports SQL Server using PHP 5.6. See the documentation:
https://wiki.processmaker.com/3.3/Datab ... ions/MSSQL