Solved

PHP4 Pages do not work with PHP5

Posted on 2006-07-08
5
166 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

816 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

8 Experts available now in Live!

Get 1:1 Help Now