Fedora 5 - MySQL 5 and PHP 5 - anyone tried?

kashurjmax wrote on Wednesday, March 22, 2006:

Anyone given a try to installing openemr/freeb/sql-ledger on Fedora 5 yet. MySQL 5 has transaction support that could be valuable in the future. I am downloading the Fedora ISO and will try to install over the next few days. Will keep all posted

sunsetsystems wrote on Thursday, March 23, 2006:

OpenEMR will definitely need some fixes to work with PHP5; I’m not sure how much work that will be.

If someone is going to support transactions in MySQL, that would also be a good time to build in support for Postgres (which already has transaction support).

– Rod
www.sunsetsystems.com

kashurjmax wrote on Friday, March 24, 2006:

I did create a VM for Fedora 5 and got a bunch of errors as expected. Some related to PHP 5 and some related to MySQL 5. I fixed the PHP errors in openemr/library/adodb/adodb-iterator.inc.php by adding the word abstract before the 2 class declarations. I had to change a few settings in the php.ini file to make it less strcict and then I encountered the MySQL 5 issues. The file  interface/main/calendar/modules/PostCalendar/pnuserapi.php generates some SQL like SELECT DISTINCT a.pc_eid, a.pc_informant, a.pc_catid, a.pc_title, a.pc_time, a.pc_hometext, a.pc_eventDate, a.pc_duration, a.pc_endDate, a.pc_startTime, a.pc_recurrtype, a.pc_recurrfreq, a.pc_recurrspec, a.pc_topic, a.pc_alldayevent, a.pc_location, a.pc_conttel, a.pc_contname, a.pc_contemail, a.pc_website, a.pc_fee, a.pc_sharing, b.pc_catcolor, b.pc_catname, b.pc_catdesc, a.pc_pid, a.pc_apptstatus, a.pc_aid, concat(u.fname,’ ‘,u.lname) as provider_name, concat(pd.lname,’, ',pd.fname) as patient_name, concat(u2.fname, ’ ', u2.lname) as owner_name, DOB as patient_dob, pd.pubpid FROM openemr_postcalendar_events AS a, openemr_postcalendar_categories AS b LEFT JOIN users as u ON a.pc_aid = u.id LEFT JOIN users as u2 ON a.pc_aid = u2.id LEFT JOIN patient_data as pd ON a.pc_pid = pd.pid WHERE b.pc_catid = a.pc_catid AND a.pc_eventstatus = 1 AND ((a.pc_endDate >= ‘2006-03-23’ AND a.pc_eventDate <= ‘2006-03-23’) OR (a.pc_endDate = ‘0000-00-00’ AND a.pc_eventDate >= ‘2006-03-23’ AND a.pc_eventDate <= ‘2006-03-23’)) which works fine on Mysql 4 but not on Mysql 5. I am trying to debug this right now, see how far I can get .
To be continued …

sunsetsystems wrote on Tuesday, March 28, 2006:

When you get things figured out (or give up trying!), be sure to summarize for us.  I would be good to get any fixes into the source base.  Also it will be helpful if you can check that your fixes don’t break existing PHP/MySQL compatibility.

Thanks!

– Rod
www.sunsetsystems.com

markleeds wrote on Friday, April 07, 2006:

kashurjmax:

Where you added abstract before the class, I know that the error message recommends that, but I don’t know if that’s the appropriate solution.  it looks like the problem is that the class extends a parent class which is abstract and it does not implement all of the virtual functions.  I remember that this comes up often in java.  I resolved it by adding a stub function to implement the missing function.

I am now up against the mysql error with the calendar.  Looking at the code, it looks like it could actually be a PHP error where a global variable is not set.  Turning on register_globals did not fix it though.

I am going to play around with this too now that I have a test area set up with.

markleeds wrote on Friday, April 07, 2006:

you’re right, its a mysql 5 problem.  something with the LEFT JOIN syntax I think. 

markleeds wrote on Friday, April 07, 2006:

I think I patched up the main problems preventing a normal login when using MySQL and PHP 5.  I don’t know if they are the best fixes, but, for now, I seem to be able to use OpenEMR normally with Apache 2.2, PHP 5, Mysql 5.

There is a good discussion of what seems to be the mysql problem here:

http://forums.devshed.com/mysql-help-4/mysql-5-0-left-joins-not-working-correctly-301347.html

I went with the workaround solution because I didn’t see how to apply the appropriate fix of fixing the joins.

Otherwise, the other few problems seem to be OOP related with PHP5 being more strict.

All problems seem to be Calendar and Smarty related.

Here are some notes I took to myself while going through this:

Fatal error: Class ADODB_Iterator contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Iterator::valid) in /usr/local/apache2/htdocs/openemr/library/adodb/adodb-iterator.inc.php on line 47

fix:

added stub function:

function valid() {}

to ADODB_Iterator

----

added () to FROM clause in pnuserapi.php at lines 736, 953 (the ‘workaround’)

----

/usr/local/apache2/htdocs/openemr/interface/main/calendar/modules/PostCalendar/pnincludes/Smarty/plugins/function.eval.php

changed this to _this

       $_this->_compile_template("evaluated template", $var, $source);
    $source = ""

and set source to "" after compile_template

I have no idea what I am messing up by doing this.

(end of notes)

Hope this helps.  So far, the only other problems I’m having are due to not updating the database structure for my data.  I may go live with this setup if it works ok with further testing over the next week or two.

kashurjmax wrote on Sunday, April 09, 2006:

markleeds - thanks for the great work - I will try this and see if it works. I was out all this time - couldnt get to working on openemr.
The big question, as you asked, is what does the last code change break ?