Solved

Restoring PHP to a previous version

Posted on 2013-06-06
12
563 Views
Last Modified: 2013-06-07
I made a huge mistake and upgraded my linux server (CentOS).  I'm not ready for the version of php and I need to restore it.  Its in a business environment and I need to get this back to working soon.  I have backups (from three days ago) of the directories and their data.  Would it...could it be as simple as overwriting the php, apache and mysql files (not the databases!) with what I've backed up??

If so...what should look for in replacing for each of these to be sure its back to working??

Please...and thanks to whoever helps me out.  I'm in a state of desperation right now.
0
Comment
Question by:Gabriel7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 1

Expert Comment

by:Uvg
ID: 39228085
You need to specify versions to acquire more help.
It looks like you upgrade to 5.3 from 5.2. In that case you need to remove php 5.3 and install 5.2 from distro repository using standard utilities.
0
 

Author Comment

by:Gabriel7
ID: 39228101
Having difficulty finding it.
0
 
LVL 1

Expert Comment

by:Uvg
ID: 39228178
#yum list php
will list of installed php package

#yum search php
will show available php packages

It seems to me you have php53 package installed. You may remove it and install php package.

Additionally you can use:
#yum downgrade php
To downgrade php package
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:Gabriel7
ID: 39228190
I was thinking about using downgrade, but I wasn't sure if it would damage my databases or what it actually did when it downgraded.  When I ran the process it showed that it was downgrading certain files and deleting others...it was a scary list ...I didn't move forword.  Because I'm guessing I'd have to downgrade apache and mysql at the same time right?
0
 
LVL 1

Expert Comment

by:Uvg
ID: 39228207
No.
You don't need to downgrade apache and mysql in case you have php53 installed and need php package.
But if you want to downgrade php to previous package version - yes. All packages that have a dependency need to be downgraded too. Upgrading and downgrading is safe operations until you use repository from the same version of the OS. Application packages have no relationship with data stored on server.
If you downgrade mysql to previous  version - there will be no problem with data if you still using the same major/minor version of mysql.
For example if use mysql-5.1-<xxx> package you can downgrade to mysql-5.1-<yyy> package safely.
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39228636
All you need to do is recompile php from source. I tend to stay away from RPM's when it comes to LAMP. php.net will allow you to download older versions. If you are running RPM's you need to get your config line first. Create a info.php file with:

<?php
phpinfo();
?>

Open in new window


Look under system configuration and copy that to a safe place. Any of the dependancies you would have to download source then compile. PHP does a pretty good job letting you know what it's missing.

Here is my config that is on a PCI complient server:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/php --with-openssl --with-zlib --with-mysql=/usr --with-mysql=/usr/local/mysql --with-curl  --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr  --enable-gd-native-ttf --with-gd

Open in new window

0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39228656
Give us a hint, please.  What's not working?  Why do you think you want to downgrade?  There may be other solutions that are far easier.  What are the symptoms of trouble?
0
 

Author Comment

by:Gabriel7
ID: 39229884
Bad programming on the php side.  Things that became deprecated with the newest version.  I need to go through and convert but it wasn't the right thing to do.

The thing that I didn't do that I should have before I upgraded was to create a snapshot (VMWARE)...and god am I kicking myself.

I ended up pulling myself out by grabbing the last snapshot and porting all the data over...but that was just a nasty experience.  

I need to make the sites compatible with the newer php.  Just no easy way of doing that quickly.

Recovered everything (I did try nearly everything on this page, but in the end I was up against a wall).  People started coming in at 6:00.  I got everything that was needed done by 6:13 am.  Haven't slept...
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39229909
I feel your pain! One of my systems is in the same boat with old code so I can relate.
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39229968
You can find upgrade-related information in the PHP.net changelogs.  Check the "Migrating From" links in the left side bar.
http://php.net/manual/en/history.php

Things that are deprecated usually continue to work - they just issue "deprecated" messages.  You can suppress these messages (while you work to remove the unwanted dependencies).  Just set the error_reporting() to include ^E_DEPRECATED.

Some things must be remediated.  Two that come to mind are covered in these articles.  But you're probably already past that part, and if you're not, you should prepare yourself because these may require actual programming changes, not just suppression of messages.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_6630-Magic-Quotes-a-bad-idea-from-day-one.html
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_7317-Register-Globals-a-bad-idea-from-day-one.html

Is it a good idea to suppress messages?  No, of course not.  It's like putting black electrical tape over the warning light on your dashboard.  Eventually something might go wrong.  But if you suppress the messages you may be able to continue running your server without interruption.  Best regards, ~Ray
0
 

Author Closing Comment

by:Gabriel7
ID: 39230509
Thanks for above and beyond!
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39230772
Thanks for the points, and good luck with the upgrade! ~Ray
0

Featured Post

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
geting data from the array list 6 38
How do I Import CSV File In my PHP Application 29 79
sitemap.xml 3 32
Can't Find The Code 15 22
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question