Solved

PHP4 Pages do not work with PHP5

Posted on 2006-07-08
5
161 Views
Last Modified: 2010-04-22
Hi,

I have just migrated a website written with PHP 4.1.2 and MySQL 3.23.56 with RH 7.3 to a new platform that consists of Fedora Core 4, PHP 5.0.4 and MySQL 4.1.20. My website shows OK except for all the operations that involve database. I've heard that there is a compatibility issue between PHP 4 and 5. Which is the quickest solution to the problem (preferably without changing the code) ?

Thank you
0
Comment
Question by:agubaira
  • 2
5 Comments
 
LVL 24

Expert Comment

by:fridom
ID: 17067099
removing PHP5 or installing a PHP4 side by side to you PHP5. Or checking the proper database libraries.

Regards
Friedrich
0
 

Author Comment

by:agubaira
ID: 17068178
Friedrich,

Thanks for your reply. How do I install PHP4 parallel to PHP5 and still have both functionalities ? What do you mean by checking database libraries ? I am sorry but I am new with PHP and MySQL.

Regards.
Antonio
0
 
LVL 24

Accepted Solution

by:
fridom earned 500 total points
ID: 17070795
http://www.howtoforge.com/apache2_with_php5_and_php4

Shows an example

And checking the db library means exactly that. See how you can connect with PHP4 and then try to get connection with PHP5 maybe the proper librarry for 5 is not yet installed.

You can write cli-tools with PHP4 and PHP5 and so you can test the database connection also.

with something along the following lines:

#!/usr/local/bin/php4
  <?php
      $connection = @ mysql_connect("localhost", "user", "password");
      if (! $connection) {
        echo "Connected";
      } else {
        echo "No connection\n";
        mysql_close($connection);
      }
      ?>

Now you can try the php4 one time and php5 the other time.

If you do not have the knowledge doing that yourself it may be the right time to look for
some unix guy nearby ;)

Regards
Friedrich

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now