Jump to content

Upgrading from PHP4 to PHP5.4


Go to solution Solved by requinix,

Recommended Posts

Hi,

 

I previously had problems with a database but thanks to the help of phpfreaks' community I was able to resolve the issue.  I now have another favor to ask of the community.  The hosting site that hosts the webpage is upgrading from PHP4 to PHP5 and up and will no longer be supporting PHP4.  I have Googled how to upgrade from PHP4 to PHP5 and up but the only problem is that everything I find has nothing to do with the code that I can see on the server.

This is the website that I have looked at: http://php.net/manual/en/migration5.php

I noticed that they claim that " Most existing PHP 4 code should be ready to run without changes "

My problem is that I am worried that when the hosting service completely phases out of PHP4 that my current code will not work.  So I kept reading through the manual and I read that I have to change CLI, CGI, configuration files, etc.  The only problem is that I do not see any of those files that I need/should be changing on the server.

Should I be worried or should I wait until they completely phase out of PHP4 to see if I need to change anything?

 

Thanks again!

 

Mark

Link to comment
https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/
Share on other sites

Do they not offer PHP 5 right now? Transition your web site to it while you still have the luxury of being able to use both.

 

Otherwise just grab a normal version of 5.4 and try your site on it. If you've had to work around the hosting provider's configuration (like safe mode or open_basedir) then you will probably have to in the new configuration to some degree as well (safe mode is gone but open_basedir is still around).

Do they not offer PHP 5 right now? Transition your web site to it while you still have the luxury of being able to use both.

 

Otherwise just grab a normal version of 5.4 and try your site on it. If you've had to work around the hosting provider's configuration (like safe mode or open_basedir) then you will probably have to in the new configuration to some degree as well (safe mode is gone but open_basedir is still around).

 

Thanks for the quick reply!  I am still a beginner at all this PHP and hosting stuff so I will try to give as much information as possible.

 

The hosting service has an option for choosing the global PHP version for the web space.  When I change it to PHP5.4 and click save does that mean the server has automatically switched to hosting the webpage with PHP5.4 and completely removed the PHP4 version?  In other words is the webpage now hosted using PHP5.4 and that if it works now then it will work in the future when they phase out of PHP4?

 

Thanks !

When I change it to PHP5.4 and click save does that mean the server has automatically switched to hosting the webpage with PHP5.4 and completely removed the PHP4 version?

That sounds like the case, yes. You can verify by creating a file called phpinfo.php that contains the code:

<?php phpinfo(); ?>
When you load that file in the browser it will show you a bunch of information about how PHP is configured, including what version you are using at the top. Make the change and load that file, see if it says you are using 5.4

That sounds like the case, yes. You can verify by creating a file called phpinfo.php that contains the code:

<?php phpinfo(); ?>
When you load that file in the browser it will show you a bunch of information about how PHP is configured, including what version you are using at the top. Make the change and load that file, see if it says you are using 5.4

 

 

Thanks for the reply!

 

Okay I did that and for some reason it says that it's PHP version 5.2.17.

I tried changing the global PHP version back to 4.0 and it still says version 5.2.17.

 

I don't think that's right is it?  Does that mean that changing the global PHP version has no affect on the actual PHP version being used?

Thanks for the reply!

 

Okay I did that and for some reason it says that it's PHP version 5.2.17.

I tried changing the global PHP version back to 4.0 and it still says version 5.2.17.

 

I don't think that's right is it?  Does that mean that changing the global PHP version has no affect on the actual PHP version being used?

 

Hey,

 

I looked up a couple things and it seems that instead of creating a .htaccess file and including this (which was what I did making the webpage run on PHP 5.2.17)

AddHandler x-mapp-php5 .php 

I changed the .htaccess file to include the following:

AddHandler x-mapp-php6 .php

That in turn didn't change the webpage at all but it did change the PHP version to 5.4.16

 

So will the webpage (if in it's current state works like it used to with PHP4) work when the hosting server phases out of PHP4 like it used to back in the PHP4 days?

 

I'm sorry if I'm being a little obsessive and noob over this problem I just want to get it right.

 

Thanks again!

  • Solution

So will the webpage (if in it's current state works like it used to with PHP4) work when the hosting server phases out of PHP4 like it used to back in the PHP4 days?

Probably: I doubt they'll drop support for 5.2 (considering how they're only now dropping 4) so if you use that then you should be fine.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.