Robert_Wynter Posted July 15, 2015 Share Posted July 15, 2015 I'm working on updating a clients webpage and the existing code is written in old school php syntax and running on PHP 5.3.29 I've tried a few local servers, WAMP,AMP, easyPHP with no luck getting his existing page to work locally and the client is not willing to upgrade to PHP 5+. Does anyone have any suggestions that can help me get it going locally Quote Link to comment Share on other sites More sharing options...
fastsol Posted July 15, 2015 Share Posted July 15, 2015 The server version isn't really an issue that needs to be solved to initially find out why the code is not working. Initially you need to make sure you have a fully installed server to work with and then make sure that error_reporting is turned on and display_errors is on also. You can do that globally in the php.ini file or at the top of any php page like this ini_set('display_errors',1); error_reporting(E_ALL); Once those errors start to show up, then you can decide based on those errors if it's really a php version issue because old code won't work on the new version. Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 15, 2015 Share Posted July 15, 2015 (edited) First I'd find out why the client is willing to run 10+ year old PHP versions. Edited July 15, 2015 by scootstah Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted July 15, 2015 Share Posted July 15, 2015 If you still do not get any errors after doing as fastcol suggested, then one thing that could prevent the code from working is the use of short open tags <? ?> throughout the code rather then the full php tag <?php ?> tags. You maybe able to enable a setting call short_open_tags in the php.ini, but this is deprecated never version of php will complain. I would recommend converting all short tags to the full php syntax. Quote Link to comment Share on other sites More sharing options...
Robert_Wynter Posted July 15, 2015 Author Share Posted July 15, 2015 @ fastsol which fully installed server would you suggest? @ scootstahbelieve me I've tried to convince them I'd much prefer to code in mySQLi. The problem is he wrote the old code himself a long time ago and doesn't want to let go but at the same time does not have the time to do it himself. Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 15, 2015 Share Posted July 15, 2015 If you've forced to use an old version, I'd recommend you install VirtualBox and setup a virtual machine to install the specific version of PHP and MySQL. Otherwise you're going to endure massive headaches. Quote Link to comment Share on other sites More sharing options...
fastsol Posted July 15, 2015 Share Posted July 15, 2015 If you're using Windows, I would suggest WAMP. I have WAMP and it works perfect on my laptop. What you use is up to you based on your machine and abilities to get it installed properly. How many files are we talking that need to be updated? If it's just a few, maybe just scan through them in Notepad++ for outdated functions or <? short tags like suggested above. Find any issues and upload them to a server quick and test them there, rather than installing a outdated server locally. Quote Link to comment Share on other sites More sharing options...
Robert_Wynter Posted July 15, 2015 Author Share Posted July 15, 2015 I've tried Wamp for Windows and I was unsuccessful getting the PHP version down to 5.3.29. I'm sure I'm doing something wrong but haven't figured that out yet. There are only 6 pages so far. However he has multiple webpages hosted on his server and therefore he not willing to do the update even though he received update notifications every-time he logs in. He's old school and believes it's going to break his server LOL Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 15, 2015 Share Posted July 15, 2015 I really wouldn't recommend working on older PHP4 code in a PHP5 environment. Your development environment needs to match what it's going to be running on, otherwise you're going to get quirky little bugs. Going from such extreme version differences is going to exacerbate that. If it were me, I'd go with a virtual machine and compile PHP from source for the version he's running. Quote Link to comment 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.