It’s going to take a patch to rename the password_hash function defined in OpenEMR to not conflict with PHP 5.5’s version, and it’s unclear if there are other potential issues with 5.5 that may arise.
Suggest that you downgrade to 5.4. From what I can tell 5.5 comes from a test repository anyway.
Thanks for the quick reply. I have installed openemr-4.1.2 successfully on my external harddisk running Ubuntu 13.04 with php5.4.9-4. I will wait for the patch before I migrate back to Fedora 19 & php5.5.3.
Your shotgun either grazed the target or at the very least flushed it out.
A search for more details on SELinux is what lead to my discovery of PHP 5.5 conflicting password_hash function. A larger set of differential diagnoses is generally more likely to result in finding the correct one.
I’ve been running PHP 5.5 for over a month now. When I was attempting to install OpenEMR, I ran into the error “Cannot redeclare password_hash() …” Now without “downgrading” to PHP 5.4 we can get OpenEMR working with just a few steps.
Open the PHP configuration (php.ini)
For me this was located at “/etc/php5/apache/php.ini” and optionally for the CLI “/etc/php5/cli/php.ini”
Edit the “disable_functions” directive
Once you locate the directive, you may find it’s commented out or already has a list of functions. If there is a value after the directive, add “password_hash” without the quotes to the end after a comma. Otherwise you can just add this line “disable_functions = password_hash” again without the quotes.
Don’t forget to save the changes to the file
Restart your web server (Apache)
On my system I used the command “sudo apache2ctl graceful”
THIS IS A “TEMPORARY” WORK-AROUND
Keep in mind this issue is due to a new CORE PHP function “password_hash” being added in the PHP 5.5.0 release and conflicting with an OpenEMR user defined function of the same name. If by some chance you have other applications running on the same system which make use of the new PHP CORE function, this work around will make those applications fail. If you have PHP MPM setup with Apache MPM Prefork, then you should be able to localize this change to the OpenEMR Virtual Host.
LONG-TERM CORRECTION
In keeping with improving OpenEMR, a solution that would correct this is implementing Namespace for the application, or renaming the function. It was common practice in PHP before Namespace adaptation, to see application function names proceeded with an application specific prefix. In this example “password_hash” would become “oemr_password_hash”, and with only a handful of locations in the code to change this would be an efficient modification without seriously hindering any backwards compatibility.
NOTE: If we look at the fact that namespace is becoming the defacto standard for name collision correction, as it is in many languages, then implementing namespace would be the correct way to solve this issue. Keeping in mind that it would be a larger change to the whole of the project.
I already have a commit for that does exactly that with oemr_password_hash, and for consistency I also renamed password_salt to oemr_password_salt.
Haven’t pushed it to master yet.
The problem with using namespaces is that Brady and Rod insist on backward compatibility all the way to 5.2.x, which doesn’t support them.
Regarding namespacing, appears that it would involve another resource intensive code walk through; I am pretty sure this is the first time this has happened to the OpenEMR codebase. The problem is Kevin is too good at naming functions (mine would of been something like create_password_hashy, thus would be safe from php thieves since such a poor name). We could decide to implement that all new functions need oemr_ before or _oemr after them unless the function names are already way too long.
I realized that my temporary work-around doesn’t work. I thought it did, because I failed to revert the naming changes I made. Even though the internal function is disabled, it’s still defined… thus the same error will occur “Cannot redeclare password_hash()…”.
I upgraded Ubuntu 13.04 to Ubuntu 13.10. Now I have the same problem as in Fedora 19 … I cannot login either with admin or my other users. I tried a fresh install with openemr-4.1.2.tar.gz but the setup stopped (http://localhost/openemr/setup.php?site=default) with a blank screen.
(I removed openemr in /var/www/ and dropped openemr at the mysql server for the fresh installation of openemr-4.1.2)
Hi,
The bug that keeps on giving
I think this bug will kill installation and also kill the ubuntu package?
May need to release updated 4.1.2 packages along with the typical 4.1.2 patch for this fix. Thoughts anyone?
-brady OpenEMR
Hi,
The bug that keeps on giving
I think this bug will kill installation and also kill the ubuntu package?
May need to release updated 4.1.2 packages along with the typical 4.1.2
patch for this fix. Thoughts anyone?
-brady
OpenEMR http://www.open-emr.org/
Have you been able to get patch 3 into the package to resolve the problem with Ubuntu 13.10 & Fedora 19 ? If not, the insertion should be imminent and then you can use Brady’s package.
Just to add, installation using patch 3 worked on a fresh installation of openemr-4.1.2 in Fedora 19 like a charm. Upgrade from 4.1.1 (14) failed however.