Php 5.4 and magic_quotes_gpc

gutiersa wrote on Saturday, May 19, 2012:

I run a freebsd 9 server with openemr 4.1.0_10.
I just did my usual upgrade maintenance, and php5 changed from 5.3 to 5.4.
magic_quotes_gpc has been removed altogether from php5

here is a workaround

http://php.net/manual/en/security.magicquotes.php

However, I’m gonna have to roll back to php5.3 right?

sandra

gutiersa wrote on Sunday, May 20, 2012:

when I change php.ini to display errors, I get this when I try to log in:

Fatal error: Call-time pass-by-reference has been removed in /usr/local/www/apache22/openemr/library/freeb/xmlrpcs.inc on line 498

Also I tried to roll back to the php5.3.10 version, but it does not safe anymore (can’t get it for freebsd anymore, I dunno how to build myself. I usually install ports)

thanks for any help

sandra

yehster wrote on Sunday, May 20, 2012:

https://github.com/yehster/openemr/commit/f4792298ac7808ced30f43dd1dfdefe690773d56
Sandra,
This commit addresses call time pass by reference in a couple of files.
I hope that you did this on a test server and are still able to get work done.

gutiersa wrote on Sunday, May 20, 2012:

did it on both test and production server. php5.3.10 had been coming up with security issues for a while. Once the fix was available I updated it. the problem is this fix is now not compatible with openemr.

Beware, I think even php5.3.13 is not compatible with openemr.

thanks sandra

gutiersa wrote on Sunday, May 20, 2012:

thanks, that worked. I can get into the system. and see a patient chart.
However there is a lot of strict standard warnings for “passed by reference”  and “assigned by reference”

Also I should expect more fatal errors with “call time pass by reference”?

Does netbeans pick out these errors?

sandra

bradymiller wrote on Sunday, May 20, 2012:

Hi,

Just to clarify, php5.4 and magic quotes in OpenEMR should not be an issue. Since in 5.4, it appears the get_magic_quotes_gpc() function call simply returns FALSE rather than erroring out in php5.4 (so, it’s the same as simply turning off magic quotes in previous php versions, which works in OpenEMR):
http://us3.php.net/manual/en/migration54.incompatible.php

So, magic quotes should not be an issue for OpenEMR in php5.4.

Sandra, I am assuming from your most recent post, that php5.4 is now working with OpenEMR with yehsters above commit. if you’re still using php5.4, the best thing to do is to start testing everything on your testing instance, and let us know if you get any more fatal errors

thanks,
-brady
OpenEMR

gutiersa wrote on Sunday, May 20, 2012:

Yes I agree, I got rid off the magic_quotes message by commenting out its reference in php.ini. Also I reviewed globals.php and realized that it should not be an issue like you mentioned above.

the fatal error is with:

Call-time pass-by-reference

Tomorrow I will be able to tell in which other files, if any, it becomes an issue.

For now I am getting the “strict standard” issues above. This will probably become a problem with future php upgrades.

If I get more fatal errors, I will start a new thread

thanks
Sandra

bradymiller wrote on Sunday, May 20, 2012:

Hi Sandra,

Just let me know how it works. If yehster’s commit fixes things completely, then probably worth it to include this in a new OpenEMR 4.1.0 patch so others don’t get white screen of death like you did after upgrading their os’s.

-brady
OpenEMR

gutiersa wrote on Monday, May 21, 2012:

“white screen of death”

yeah that is the best way to describe it.

Ok I will do.

thanks
sandra

gutiersa wrote on Tuesday, May 22, 2012:

PHP 5.4 and openemr
so far, so good.

bradymiller wrote on Saturday, May 26, 2012:

Hi,
Thanks for testing it. Will place this fix in the next 4.1.0 patch.
-brady
OpenEMR

gutiersa wrote on Saturday, May 26, 2012:

Yes, we went a full week without any problems, including documents and billing. So openEMR 4.1 is compatible with php 5.4 so far.
~Sandra

yehster wrote on Tuesday, May 29, 2012:

I have a another server instance running php 5.4.3 now so I have started looking into this.

https://github.com/yehster/openemr/tree/fix-calendar-strict

yehster wrote on Tuesday, May 29, 2012:

By “this” I mean the Strict Standard warnings for static call of non-static functions and inappropriate use of references.

bradymiller wrote on Wednesday, May 30, 2012:

Hi,
Nice. I like the idea of actually fixing them before they become errors in the future.
-brady
OpenEMR Project

yehster wrote on Wednesday, May 30, 2012:

Filling up the log with messages *is* an error in my book. It’s so much easier to catch silly mistakes like typos in variable names if there isn’t a lot of junk to filter.

bradymiller wrote on Wednesday, May 30, 2012:

I’m glad you’re taking this on. Will be nice to get a blank log.
-brady