Results 1 to 12 of 12

Thread: PHP 5.2 to 5.3

  1. #1
    Join Date
    Jun 2008

    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?

    Thanks much.

    Any help would be much appreciated.


  2. #2
    Join Date
    Jul 2007
    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.

  3. #3
    Join Date
    Jun 2008
    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.).

  4. #4
    Join Date
    Aug 2004
    Looks like a MySQL error, not a PHP error.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  5. #5
    Join Date
    Jun 2008
    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.

  6. #6
    Join Date
    Aug 2004
    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).
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  7. #7
    Join Date
    Jun 2008
    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!

  8. #8
    Join Date
    Jun 2008
    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);

  9. #9
    Join Date
    Aug 2004
    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.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  10. #10
    Join Date
    Jun 2008
    Thanks NogDog,

    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.

  11. #11
    Join Date
    Feb 2013
    give the full tutorial of php please

  12. #12
    Join Date
    Jun 2008
    Quote Originally Posted by zeeshanaayan07 View Post
    give the full tutorial of php please
    Not quite sure I understand your request.
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.11317 seconds
  • Memory Usage 2,975KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (12)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (12)postbit
  • (12)postbit_onlinestatus
  • (12)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (72):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates