Cannot unset $this in adodb-xmlschema.inc.php / Problem when installing manually

quiquedcode wrote on Thursday, December 15, 2016:

Hi
I decided to install openemr manually using UniformServer and latest openemr
I extracted, created database, privileges, etc. and all went great until step 4, php-gacl

I’m getting this error in logs

[Wed Dec 14 21:06:39.877235 2016] [php7:error] [pid 4616:tid 1728] [client ::1:54477] PHP Fatal error:  Cannot unset $this in D:\\openemr\\UniServerZ\\www\\hc\\library\\adodb\\adodb-xmlschema.inc.php on line 160, referer: http://localhost/hc/setup.php

This is where I’m getting stuck

quiquedcode wrote on Thursday, December 15, 2016:

In case someone is wondering… UniformServer is one of the most lightweight WAMP environments with latest versions of php, mysql, apache, etc. all configured to be the most portable possible.
That’s why I dediced to go manually. I need a fast server in a not so fast workstation, which xampp does not help much in this way

bradymiller wrote on Saturday, December 17, 2016:

Hi Enrique,

Guessing the simple answer will be that it is related to UniformServer, but perhaps there is a php7 bug here that can be addressed. What version of OpenEMR are you installing?

-brady
OpenEMR

benzev wrote on Sunday, February 12, 2017:

Fatal error: Cannot unset $this in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/adodb/adodb-xmlschema.inc.php on line 160

This is what I get from attempting to install Openemr 4.2.2. (Windows) via Xampp 7.1.1 on Macos Sierra

Previous notices were:

Notice: Undefined index: igroup in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 17

Notice: Undefined index: server in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 18

Notice: Undefined index: loginhost in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 19

Notice: Undefined index: port in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 20

Notice: Undefined index: root in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 21

Notice: Undefined index: rootpass in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 22

Notice: Undefined index: login in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 23

Notice: Undefined index: pass in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 24

Notice: Undefined index: dbname in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 25

Notice: Undefined index: collate in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 26

Notice: Undefined index: source_site_id in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 28

Notice: Undefined index: no_root_db_access in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 30

Notice: Undefined index: development_translations in /Applications/XAMPP/xamppfiles/htdocs/openemr/library/classes/Installer.class.php on line 31
OpenEMR Setup

Notice: Undefined index: inst in /Applications/XAMPP/xamppfiles/htdocs/openemr/setup.php on line 171
Step 4

Installing and Configuring Access Controls (php-GACL)…

bradymiller wrote on Wednesday, February 15, 2017:

Hi Ben,

Try to use the following OpenEMR package instead which as I recall uses an updated adodb library (guessing this errors stems from the newer php version you are using):
http://opensourceemr.com/cvs/openemr-500-cvs.tar.gz
(this is a daily build from the openemr 5.0.0 development version)

Note will be releasing 5.0.0 tomorrow, so could then use that package when it’s out.

-brady
OpenEMR

benzev wrote on Wednesday, February 15, 2017:

Thanks Brady, I will wait for the 5.0.0 tomorrow

benzev wrote on Thursday, February 16, 2017:

I have tried now with the Linux 5.0.0 and got to this point, (not sure if I should use the Windows versions?)

We will now ensure correct file and directory permissions before starting installation:
Ensuring following files are world-writable…
‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/sites/default/sqlconf.php’ file is ready.
‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/interface/modules/zend_modules/config/application.config.php’ file is ready.

Ensuring following directories have proper permissions…

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/sites/default/documents’ for writing by web server.
(configure directory permissions; see below for further instructions)

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/sites/default/edi’ for writing by web server.
(configure directory permissions; see below for further instructions)

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/sites/default/era’ for writing by web server.
(configure directory permissions; see below for further instructions)

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/sites/default/letter_templates’ for writing by web server.
(configure directory permissions; see below for further instructions)

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/gacl/admin/templates_c’ for writing by web server.
(configure directory permissions; see below for further instructions)

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/interface/main/calendar/modules/PostCalendar/pntemplates/compiled’ for writing by web server.
(configure directory permissions; see below for further instructions)

UNABLE to open directory ‘/Applications/XAMPP/xamppfiles/htdocs/openemr-5.0.0/interface/main/calendar/modules/PostCalendar/pntemplates/cache’ for writing by web server.
(configure directory permissions; see below for further instructions)

You can’t proceed until all directories are ready.
In linux, recommend changing owners of these directories to the web server. For example, in many linux OS’s the web server user is ‘apache’, ‘nobody’, or ‘www-data’. So if ‘apache’ were the web server user name, could use the command ‘chown -R apache:apache directory_name’ command.
Fix above directory permissions and then click the ‘Check Again’ button to re-check directories.

bradymiller wrote on Friday, February 17, 2017:

Hi Ben,

Try the Windows file (this is a zip package). And if still not working then need to set write privileges for apache the above directories. See section at bottom of this wiki page for setting permissions in mac:
http://www.open-emr.org/wiki/index.php/OpenEMR_4.1_Lion_Server

-brady
OpenEMR

benzev wrote on Sunday, February 19, 2017:

Thanks Brady, I have now tried the Windows 5.0.0 zip file version and get to this point:

OpenEMR Setup

Step 3

Configuring OpenEMR…

Connecting to MySQL Server… OK.
Creating database… ERROR. Check your login credentials. unable to execute SQL: ‘create database openemr character set utf8 collate utf8_general_ci’ due to: Can’t create database ‘openemr’; database exists

Do I need to remove my current xampp installation to remove vestiges of earlier installation attemps?

Regards

Ben

benzev wrote on Sunday, February 19, 2017:

I will answer my own question by looking at past advice that needed one to open Phpadmin on the Localhost and Drop (delete) the database called Openemr

bradymiller wrote on Monday, February 20, 2017:

Hi Ben,

Does this mean you got it to work? :slight_smile:

-brady
OpenEMR

benzev wrote on Monday, February 20, 2017:

Hi Brady

Not quite yet I got this error further down:

OpenEMR Setup

Step 4

Installing and Configuring Access Controls (php-GACL)…

Fatal error: Cannot declare class Cpdf, because the name is already in use in /Applications/XAMPP/xamppfiles/lib/php/Cpdf.php on line 19

bradymiller wrote on Monday, February 20, 2017:

just posted reponse to that here:
https://sourceforge.net/p/openemr/discussion/202505/thread/0d45ca7c/

The class adodb-xmlschema.inc.php included in the .zip files is not compatible with PHP 7.1. If you are able to find and edit the file to replace all of the code in that file with all of the code presented here…ADOdb/adodb-xmlschema.inc.php at master · ADOdb/ADOdb · GitHub, it should work. I deleted the contents of adodb-xmlschema.inc.php, then copied and pasted this code in, saved the file, refreshed the page at step 4, and it continued with a successful install. Good luck!

Related issue on github here for reference:

And here’s the commit that brought in the new version of adodb into the development codebase: