BigBoyMarky Posted June 20, 2013 Share Posted June 20, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/ Share on other sites More sharing options...
requinix Posted June 20, 2013 Share Posted June 20, 2013 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). Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/#findComment-1436987 Share on other sites More sharing options...
BigBoyMarky Posted June 20, 2013 Author Share Posted June 20, 2013 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 ! Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/#findComment-1436991 Share on other sites More sharing options...
kicken Posted June 20, 2013 Share Posted June 20, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/#findComment-1437010 Share on other sites More sharing options...
BigBoyMarky Posted June 20, 2013 Author Share Posted June 20, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/#findComment-1437033 Share on other sites More sharing options...
BigBoyMarky Posted June 20, 2013 Author Share Posted June 20, 2013 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! Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/#findComment-1437036 Share on other sites More sharing options...
Solution requinix Posted June 20, 2013 Solution Share Posted June 20, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/279376-upgrading-from-php4-to-php54/#findComment-1437077 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.