Undefined function sqlStatementNoLog() during setup


(Aaron Chantrill) #1

Situation
I am trying to install the latest master branch on a raspberry pi running Raspbian. This is not for production, but just to give myself a place to experiment and learn.

I cloned the git repo then ran the composer and npm commands.

~$ git clone https://github.com/openemr/openemr.git
~$ cd openemr
~/openemr$ git branch
* master
~/openemr$ composer -V
Composer version 1.2.2 2016-11-03 17:43:15
~/openemr$ npm -v
6.9.0
~/openemr$ composer install
~/openemr$ npm install
~/openemr$ npm run build
~/openemr$ composer dump-autoload -o

I did not keep a log of the output from the above, but they all appeared to be successful.

Raspbian has two php.ini files, one for apache and one for cli, so I made the requested changes to the apache php.ini file (/etc/php/7.0/apache2/php.ini) and symlinked the cli file to it.

I set up apache2 to serve the openemr directory and was able to access a php-info.php file from there, so apache and php seem to be set up.

When I tried to launch index.php, it redirected me to setup.php, but then I got a white screen.

The log says this:

[Tue Mar 19 20:47:54.922702 2019] [:error] [pid 19047] PHP Fatal error:  Uncaught Error: Call to undefined function sqlStatementNoLog() in /home/aaron/openemr/library/translation.inc.php:42\nStack trace:\n#0 /home/aaron/openemr/common/compatibility/Checker.php(24): xl('PHP version nee...')\n#1 /home/aaron/openemr/common/compatibility/Checker.php(41): OpenEMR\\Common\\Checker::xlDelegate('PHP version nee...')\n#2 /home/aaron/openemr/setup.php(91): OpenEMR\\Common\\Checker::checkPhpVersion()\n#3 {main}\n  thrown in /home/aaron/openemr/library/translation.inc.php on line 42

So I tried running setup.php from the command line:

~/openemr $ php setup.php
PHP Fatal error:  Uncaught Error: Call to undefined function sqlStatementNoLog() in /home/aaron/openemr/library/translation.inc.php:42
Stack trace:
#0 /home/aaron/openemr/common/compatibility/Checker.php(24): xl('PHP version nee...')
#1 /home/aaron/openemr/common/compatibility/Checker.php(41): OpenEMR\Common\Checker::xlDelegate('PHP version nee...')
#2 /home/aaron/openemr/setup.php(91): OpenEMR\Common\Checker::checkPhpVersion()
#3 {main}
  thrown in /home/aaron/openemr/library/translation.inc.php on line 42

I found the sqlStatementNoLog function in library/sql.inc, so it seems like sql.inc is not getting referenced somewhere.

OpenEMR Version
I’m using the master OpenEMR branch

Browser:
N/A

Operating System
Raspbian

Logs

[Tue Mar 19 20:47:54.922702 2019] [:error] [pid 19047] PHP Fatal error:  Uncaught Error: Call to undefined function sqlStatementNoLog() in /home/aaron/openemr/library/translation.inc.php:42\nStack trace:\n#0 /home/aaron/openemr/common/compatibility/Checker.php(24): xl('PHP version nee...')\n#1 /home/aaron/openemr/common/compatibility/Checker.php(41): OpenEMR\\Common\\Checker::xlDelegate('PHP version nee...')\n#2 /home/aaron/openemr/setup.php(91): OpenEMR\\Common\\Checker::checkPhpVersion()\n#3 {main}\n  thrown in /home/aaron/openemr/library/translation.inc.php on line 42

Thanks,
Aaron


(Brady Miller) #2

Hi @aaronchantrill ,
Guessing you are either:

  1. Missing some php dependencies.
  2. Have permission issues.

What OS is Raspbian based on? What php version?
-brady


(Aaron Chantrill) #3

Hey Brady Miller, you are amazing. Thanks for getting back so quickly. Raspbian is basically Debian but optimized for arm processors. I really haven’t seen much difference between Raspbian and Debian. I’m using Raspbian Stretch, and it is currently up to date.

The php version is PHP 7.0.33-0+deb9u3. Where can I get a list of the dependencies for the current version? I used a list from https://www.open-emr.org/wiki/index.php/OpenEMR_System_Architecture#OpenEMR_Dependencies for “Ubuntu 16.04 and Mint 18 and Debian 9 and greater versions (PHP7) (With MySQL or MariaDB)”.

I’m using mariadb: Server version: 10.1.37-MariaDB-0+deb9u1 Raspbian 9.0

Thank you,
Aaron


(Brady Miller) #4

hi @aaronchantrill ,
OpenEMR’s most recent dev version (the master branch) requires PHP 7.1 . It should of shown a whitescreen with a message “PHP version needs to be at least 7.1.2” rather than the white screen of death, so something else is likely happening. Would get the PHP version issue fixed first and then go from there.
-brady


(Aaron Chantrill) #5

I just ran the exact same setup procedure on an Ubuntu 16.04 x86_64 system with exactly the same results.

~/openemr$ php setup.php
PHP Notice:  Undefined index: temp_skip_translations in /home/drask/openemr/library/translation.inc.php on line 15
PHP Fatal error:  Uncaught Error: Call to undefined function sqlStatementNoLog() in /home/drask/openemr/library/translation.inc.php:42
Stack trace:
#0 /home/drask/openemr/common/compatibility/Checker.php(24): xl('PHP version nee...')
#1 /home/drask/openemr/common/compatibility/Checker.php(41): OpenEMR\Common\Checker::xlDelegate('PHP version nee...')
#2 /home/drask/openemr/setup.php(91): OpenEMR\Common\Checker::checkPhpVersion()
#3 {main}
  thrown in /home/drask/openemr/library/translation.inc.php on line 42

I thought maybe there was a binary somewhere in there which was causing a failure on arm systems. So, thankfully I can eliminate that. I’m probably still missing a step in my setup process.

In both setups I have owner set to the owner of the home folder I am running out of, and group set to www-data, with 644 permissions.

Here are the modules I have loaded:

~/openemr $ php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Thank you,
Aaron


(Aaron Chantrill) #6

Okay, thank you. I think I just missed your response when sending mine. Sorry.


(Brady Miller) #7

May be easier to try to a docker setup (then don’t need to worry about any dependencies on Raspbian except for docker support).


(Brady Miller) #8

I think I see the bug here (why it is not showing the nice php error rather than whitescreen of death).


(Brady Miller) #9

fix for the message here, which will bring in when it passes travis:

Note this will only fix the whitescreen to show the message; still need to increase your php version or use docker setup (I recommend docker setup).


(Aaron Chantrill) #10

Awesome, thank you so much. You rock! I just tested your patch and am now getting the “PHP version needs to be at least 7.1.2.” message. I’m attempting to install php7.1+ on one of my machines.


(Aaron Chantrill) #11

Okay, installing PHP version 7.3 worked. I used the ondrej/php launchpad ppa to accomplish this. I’m trying to load PHP from source code on my other machine. I will also look into docker. I’m trying to figure out an ideal method for replicating both code and database to a cloud server in such a way that it is as secure as possible until the local server goes down, then can be shifted into production mode where it can be used as the primary server until the local server can be brought back up.

Thanks.