Ask questions about installing and configuring ProcessMaker 3
By gregkuhnert
#784252
Installing processmaker on a PHP 5.3.29 box... and getting some errors:

The First install screen checks out all OK. All pre-requisites met. On the next screen, a dialogue box "Checking" comes up in the middle of the screen and thats as far as it gets.

Looking at apache error log, I find this:

PHP Warning: Invalid argument supplied for foreach() in processmaker/gulliver/system/class.g.php on line 4913

The foreach error is inside a function is_writable_r ... The calling function is in the installer script. Some of the directories from the installer have no files in them on a vanilla install... and therefore it is not an array passed to foreach - and thats where it all ends. I did some hacks to get past this point, but there are multiple places elsewhere in process maker code with similar errors with foreach functions being passed stuff that is not an array.

Can I ask for confirmation - What is the required / recommended php version? Is this my issue? I can change to another version.
By gregkuhnert
#784307
Team.

See below for my fixes to this. I am curious though. How can I be the only one with this error? This is on a clean server build, and it is impossible to install without these patches.

The current code in processmaker/gulliver/system/class.g.php is:
Code: Select all
foreach ($list as $f) {
  if (! G::is_writable_r( $f, $noWritableFiles )) {
    $sw = false;
  }
}
Instead, the fix below will allow this to work as expected.
Code: Select all
if (is_array($list)) }
  foreach ($list as $f) {
    if (! G::is_writable_r( $f, $noWritableFiles )) {
      $sw = false;
    }
  }
}
After fixing this, I had a similar error in processmaker/workflow/engine/classes/model/Translation.php :
Code: Select all
foreach ($files as $file) {
    $params = self::getInfoFromPOFile( $file );
    $this->addTranslationEnvironment( $params['LOCALE'], $params['HEADERS'], $params['COUNT'] );
}
And the fixed code
Code: Select all
if (is_array($files)) {
    foreach ($files as $file) {
        $params = self::getInfoFromPOFile( $file );
        $this->addTranslationEnvironment( $params['LOCALE'], $params['HEADERS'], $params['COUNT'] );
    }
}
By gregkuhnert
#784308
Another fix here... processmaker/framework/src/Maveriks/Util/Common.php

Before:
Code: Select all
foreach ($dirs as $dir) {
    $files = array_merge($files, self::rglob("$dir/$singlePattern", $flags));
}
After:
Code: Select all
if (is_array($dirs)) {
    foreach ($dirs as $dir) {
        $files = array_merge($files, self::rglob("$dir/$singlePattern", $flags));
    }
}
User avatar
By giovani
#784410
Hi gregkuhnert,

Thanks for all of your suggestions to fix this issue.

The code modification you're suggesting will stop the error message from arising. Nevertheless, it won't fix the issue per se.

Will you please provide us with more details about your server (Linux/Windows distribution, PHP version, Apache version, MySQL version), so we can try to replicate the issue on our side?

Best,
Giovani
By gregkuhnert
#784413
I have tried multiple combinations for my testing:
PHP
5.3.28
5.4.24
5.5.29
5.6.13

Apache:
2.2.3-91.el5
2.4.6-31.el7

MySQL
5.0.95-5.el5
mariadb-5.5.44-1.el7

OS
Centos 5 or 7 derivatives

I disagree with your comment that the patches I provided will not "fix the issue per se". The fact remains that process maker is not validating the input to foreach, Processmaker is passing invalid data and PHP is generating an error. Why is it invalid data? The input data is meant to represent the files in a particular directory. On a standard vanilla install, there are no files in that directory - so therefore, it will always fail on a new install. Its a bug, pure and simple.

GK
User avatar
By giovani
#784418
Dear Greg,

I'm afraid we haven't been able to replicate this issue on our side. So, we'd like to have a meeting with you, to personally check your server and identify the causes. I just emailed you the necessary credentials and instructions, to join this meeting.

Regards,

DO we have to pay tax for trade https://www.getfir[…]

Mosquito Zapper Reviews

https://www.facebook.com/sammosquitozapper https:[…]

https://www.facebook.com/sammosquitozapper https:[…]

Are you looking for a simple method to import EML […]