Koozali.org formerly Contribs.org

Downgrade or version lock PHP and MySQL for a particular application?

Offline stabilys

  • ***
  • 73
  • Ah din't do it!!
    • http://stabilys.com
Hi all.

A client has a custom php/mysql db managment system that handles text archives.

After the most recent updates it has just broken  :shock:

The original developer is not keen on going back to it, but may yet be persuaded...

1. Is there any way to revert to the earlier MySql and PHP on SME9 to get the application to work without breaking the server?

2. Alternatively is there any way to install multiple versions of MySQL and PHP, including the previous ones just for that application?

I know about the PHP collection for software with later dependencies, but not about earlier ones. And I don't know if multiple MySQL is even feasible.

All hints appreciated, thanks.

MeJ

This, too, will pass ;)

Offline ReetP

  • *
  • 2,110
Hi all.

A client has a custom php/mysql db managment system that handles text archives.

After the most recent updates it has just broken  :shock:

Which version was installed/updated ?

Quote
The original developer is not keen on going back to it, but may yet be persuaded...

Presuming it is breaking for a version of PHP < 7.1 then the designer either needs telling to update it, or find another designer who will. Apart from the installed PHP 5.3.3 which is supported for security updates by RH, any other version of PHP below 7.1 is now EOL. That means no supports/updates, and any holes in it will not be fixed. You are leaving yourself, or your client, exposed to hacking.

Note PHP 7.1 is now supported for security fixes only and you should be using a minimum of 7.2

https://www.php.net/supported-versions.php

Quote
1. Is there any way to revert to the earlier MySql and PHP on SME9 to get the application to work without breaking the server?

2. Alternatively is there any way to install multiple versions of MySQL and PHP, including the previous ones just for that application?


https://wiki.contribs.org/PHP_Software_Collections

Quote
I know about the PHP collection for software with later dependencies, but not about earlier ones. And I don't know if multiple MySQL is even feasible.

Search. Read. Inwardly digest....

https://wiki.contribs.org/Software_Collections:MySQL55
https://wiki.contribs.org/Software_Collections:MySQL57

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline stabilys

  • ***
  • 73
  • Ah din't do it!!
    • http://stabilys.com
Which version was installed/updated ?

Thanks for the reply ReetP.

The installed executable is RH PHP 5.3.3 so I suspect it may be the MySQL version that is breaking things... it all worked up until this last weekend when most recent updates applied.

Developer annoyed that client does not want to pay for development... they may just have to :)

MeJ
This, too, will pass ;)

Offline ReetP

  • *
  • 2,110
Thanks for the reply ReetP.

NP

Quote
The installed executable is RH PHP 5.3.3 so I suspect it may be the MySQL version that is breaking things... it all worked up until this last weekend when most recent updates applied.

I can't see what updates would have broken this if you are using stock packages and not SCL packages.

Default installed versions should be something like:

Code: [Select]
rpm -qa |grep php-cphp-common-5.3.3-49.el6.x86_64

Code: [Select]
rpm -qa |grep mysql-5mysql-5.1.73-8.el6_8.x86_64

Can't remember how to show the last updates.

From the looks of this changelog I don't think there has been an update to mysql for a while. You need to properly investigate what is going on .

https://centos.pkgs.org/6/centos-x86_64/mysql-5.1.73-8.el6_8.x86_64.rpm.html

Quote
Developer annoyed that client does not want to pay for development... they may just have to :)

Same crap, different day. Bloody clients just don't get it. Until they get hacked......
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mmccarn

  • *
  • 2,436
I think the php/mysql issue is a red herring -- neither the base php nor the base mysql have had updates since early in 2017.

mysql-5.1 was last updated in Jan 2017.  The version on my up-to-date system was installed during the first 'yum update' after installation in Feb 2017.

php-5.3 was last updated in 2016 and was installed on my server in April 2017.

e-smith-php (rpm -q --changelog e-smith-php |head -10) and e-smith-mysql (rpm -q --changelog e-smith-mysql |head -10) contain the templates that control the default configuration files, and have not been updated for even longer.


Some other thoughts:

* Take a look at /var/log/yum/yum.log to see if something unexpected was installed or updated recently.

* Put a "phpinfo()" file in the same web location as your app (unless this function is already built in to the app) so you can confirm that the app is seeing the versions of php and mysql that you are expecting

* Examine the ownership of the files and folders (including the associated tmp file location) for the broken app.

* Check the section of /etc/httpd/conf/httpd.conf related to the broken app

* Look in /var/log/messages to see what SME events were run recently, and what templates they expanded

* Look in /var/log/httpd/error_log

* Use the SME audit tools to look for any nonstandard bits
  /sbin/e-smith/audittools/newrpms
  /sbin/e-smith/audittools/templates


In case it's useful, here is what I see on my up-to-date SME9 server for mysql and php -
Code: [Select]
# yum info mysql php
Loaded plugins: fastestmirror, post-transaction-actions, smeserver
Loading mirror speeds from cached hostfile
 * base: repos-va.psychz.net
 * smeaddons: ibsgaarden.dk
 * smeextras: ibsgaarden.dk
 * smeos: ibsgaarden.dk
 * smeupdates: ibsgaarden.dk
 * updates: repos-va.psychz.net
Installed Packages
Name        : mysql
Arch        : x86_64
Version     : 5.1.73
Release     : 8.el6_8
Size        : 2.4 M
Repo        : installed
From repo   : updates
Summary     : MySQL client programs and shared libraries
URL         : http://www.mysql.com
License     : GPLv2 with exceptions
Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
            : client/server implementation consisting of a server daemon (mysqld)
            : and many different client programs and libraries. The base package
            : contains the standard MySQL client programs and generic MySQL files.

Name        : php
Arch        : x86_64
Version     : 5.3.3
Release     : 49.el6
Size        : 3.5 M
Repo        : installed
From repo   : base
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP
Description : PHP is an HTML-embedded scripting language. PHP attempts to make it
            : easy for developers to write dynamically generated webpages. PHP also
            : offers built-in database integration for several commercial and
            : non-commercial database management systems, so writing a
            : database-enabled webpage with PHP is fairly simple. The most common
            : use of PHP coding is probably as a replacement for CGI scripts.
            :
            : The php package contains the module which adds support for the PHP
            : language to Apache HTTP Server.

Offline Jean-Philippe Pialasse

  • *
  • 1,330
  • aka Unnilennium
    • http://smeserver.pialasse.com
What are rhe actual errors or warning returned in messages when runing the app?

Would it happen that one installed php scl and configured php 54,55,56 or 70,71,72 as default?