PHP 5.2 to 5.3
I bought a little software 4 years ago which I really like. It was written for the PHP 5.2 server.
I use to be able to install it and run it on my hosting server, but now errors are popping up everywhere because the server is now 5.3.
Is there anyway I can update my software so it'll work on the 5.3 server?
Like a step by step instructions - find and replace this (code) by this (code) way to do it?
Any help would be much appreciated.
Short Answer: No.
I would suggest starting with php.net's migration outline.
DO NOT just "replace this code with that code", without understanding what "this code" was doing, and how "that code" is different. You'll end up in a worse place than you started. (we're in the process of migrating about 150 websites from
What error are popping up? Give us a little something to work with, so we can help point in the right direction.
Thanks for your reply.
I didn't really think that it was as simple as replacing the syntax...was just laying out my level of ignorance in the field, really
Well, the very first error I see is when I try to install the software - one of the tables couldn't be set up --
Table 4: RDV could not be created (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14), cap varchar(255), app_length varchar(255), ' at line 5)
One or more errors have occurred. The tables could not be set up properly. Please go back
and check your entries (capitalization, password etc.).
Looks like a MySQL error, not a PHP error.
That's what someone else told me- that it is a MySQL error. Although, those same errors did not exist when it was in the PHP 5.2 server.
Sheesh. It's frustrating to be a NOOBIE learning PHP when you want to build the house without cutting the logs first.
I like your Terry Pratchett quote by the way. It is so true.
All the error is telling us is that MySQL ran into a syntax error in the SQL that was sent to it by your PHP script. Until we can find and look at that actual SQL statement, it will be pretty hard to find what that actual problem is. It's entirely possible that when they updated your PHP version, they also updated MySQL, so it could possibly a version issue, though I'd place a small wager it's something different in the MySQL configuration, not MySQL itself.
PS: You didn't by any chance migrate from a Windows server to a Linux-type server, did you? Windows doesn't care about upper-/lower-case letters in file names, whereas Linux does, and since MySQL depends on file names for a lot of things, the hint from the error message about capitalization might actually be helpful (but you'd still have to find the query in your code to figure out what needs to be edited).
To be honest, I don't know if it's a windows or a linux server. Though, I believe you are right about my hoster updating the MySQL at the sametime they migrate PHP 5.2 to 5.3.
It turns out that I couldn't install the software because Timestamp (14) was being used on the install.php
I had fixed that and the install went through successfully.
Now in testing the functionalites of the software, I get these errors:
1. Function eregi() is deprecated in /home/./www/www/././list.php
2. Assigning the return value of new by reference is deprecated in /home/./www/www/././update.class.inc.php
3. Deprecated: Function split() is deprecated in /home/./www/www/././calendargrid.inc.php on line 51
Which I guess is a good thing, they seem to be very specific problems and are related to PHP this time,
I found this help manual on the migration from 5.2 to 5.3.
Am going to read it and see if I can't fix it.
Anyways, my eyeballs are fried from staring at the screen for 12 hours straight.
Am going to call it a day. I'll resume my repair quest tomorrow.
Thanks NogDog for your help. Have a good one!
Hi again everyone,
I was able to successfully update my software from PHP 5.2 to 5.3 with the help of this manual http://www.php.net/manual/en/migration53.deprecated.php
There was just one last thing that I did not understand :
Deprecated: Assigning the return value of new by reference is deprecated in /soc/update.php on line 139
Although, on the advice found on other forums, removing the (&) sign appears to have worked, I still would like to make sure that it is the thing to do, that is, I'd like to understand it - and not just simply do it. Are there any gurus here that can put it in layman's term for me?
Thanks much for your help . The code in question I changed was this -
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($out->get_object, true);
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($out->get_object, true);
I'm guessing a lot of those notices are not so much a 5.2 to 5.3 thing as it is different error_reporting settings. The assigning by reference thing I believe is more of a PHP 4.x to PHP 5.x issue, as in PHP 5 passing objects by reference became the default behavior. In PHP 4, there was at least a belief among some PHP developers that using "= & new" instead of just "= new" would improve performance. Whether or not it really had any measurable effect is now essentially a moot point in PHP 5.
So, while you likely could have "fixed" most of your new errors by simply lowering the error_reporting level (since they were just notices, not truly "errors"), it's good that you're fixing them now, in case they ever do become real errors in later versions.
I'm glad I was able to fix it on my own. I couldn't afford a reputable, trustworthy developer to fix it.
I tried to hire someone via a website where developers from beyond the borders were offering their service at a price I can afford.
After the one I was about to hire, whose English was deplorable, INSISTED they needed the "details to access my Cpanel and my database so that they could look at its structure" to do the job and that accessing the files via FTP was not enough -- I said...WOH!
Last edited by fagin; 02-09-2013 at 04:01 PM.
give the full tutorial of php please
Not quite sure I understand your request.
Originally Posted by zeeshanaayan07
I don't know PHP well enough to give a tutorial of any kind. I'm a noobie.
But if you mean the steps I took to upgrade the software from PHP 5.2 to PHP 5.3,
What I did was look up the meaning of "Deprecated" found here : http://en.wikipedia.org/wiki/Deprecated.
Then, I went here : http://www.php.net/manual/en/migration53.deprecated.php
After, I tackled the error messages appearing on the screen one by one using the manual above to replace the deprecated functions with the PHP 5.3 replacements.
Finally, I tested my software to make sure all the functionalities are not messed up in anyway and that it is working as usual as before.
Hope this answers your question.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)