URGENT- PHP errors after installing new server

Discussion in 'Web Design and Development' started by geekindisguise, Oct 9, 2009.

  1. geekindisguise macrumors 6502

    geekindisguise

    Joined:
    Jul 22, 2008
    Location:
    Oklahoma
    #1
    Oh PLEASE help!
    I just had to reinstall my server software.
    And I can't remember all the settings I had to setup for PHP.
    Could anyone tell me EXACTLY what to change in the PHP.ini file for these errors. It has shows on a Contact form somewhere on my site.

    http://jacobwilmoth.com/hostr/
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    I looked at those errors and obviously the software you're using is old - sounds like you switched from PHP4 to PHP5 along the way. If the code is from a product you downloaded somewhere, ask them for a newer version that works with the newer PHP. If you want to debug these yourself:

    In PHP 5.3.0 set_magic_quotes_runtime() is turned off by default just as the error noted. Possible solutions include to either remove it, prefix it with @ or pass 1 as the argument which emulate PHP4's default behavior for handling database queries where addslashes are used. It's a security concern to enable this function for backwards compatibility, of course. Meaning, just because you can does not mean you should.

    "Cannot modify header information - headers already sent" means output of some sort was sent before a header command, which is directly related to your source code (i.e. a newlines or space or print/echo or any output being sent at the top of the document as most common cause, i.e. cookie or session variable set after output, etc.)

    "Assigning the return value of new by reference is deprecated" refers to how class objects are referenced differently in PHP5. The general advice is to remove "&" in your class code because PHP5 implements objects using instances, similar to C pointers.

    Get the idea? With the massive number of changes in PHP5 alot of times older software has to be fixed a bit to comply. Although others reading this might suggest more tricks and PHP.ini changes to save time, I never recommend implement only those changes because I refuse to run insecure code and welcome the improvements in PHP5. That's just me, of course.

    -jim
     
  3. geekindisguise thread starter macrumors 6502

    geekindisguise

    Joined:
    Jul 22, 2008
    Location:
    Oklahoma
    #3
    I changed Display_errors to No.
    And now it removed a couple Errors from the Hostr thing. BUT- It still doesn't work.

    When I chose to not display the errors, my contact box works now. That was the most important. But I still want the Hostr thing to work. It is fairly new. And it uses CodeIgniter. I used a Tutorial from NetTuts+.

    Thanks for the Help!
     
  4. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #4
    Assuming I was right about PHP4 to 5 and you have to stay with the current webhost...

    What you did likely only hides errors, it does not fix issues.

    I never suggested you disable error display! This tells me either you tried my advice and it didn't work, or you never tried it. For now I can only speculate you don't know PHP very well, especially the newer PHP5.

    FYI, the software being "fairly new" doesn't mean it's necessarily PHP5 compatible. Tell the vender what version you're running (use "print phpinfo();" to find out) and if they have a version which is compatible. If not and you don't know PHP very well, maybe it's time to considering finding a PHP guru out there willing to help with complete access to your actual PHP source code.

    Once resolved, you should turn error display back on so it's legitimate and useful, and you'll be able to use all features of your software too. That would be my goal in this situation.

    -jim
     
  5. geekindisguise thread starter macrumors 6502

    geekindisguise

    Joined:
    Jul 22, 2008
    Location:
    Oklahoma
    #5
    Ohh, I tried your advice. And it didn't work.
    On the comment box, it had always had errors displayed, but they never affected how it worked. So I would just hide the errors.

    What exactly is the Magic Quotes setting? Is it for when I use \" or \' ??
     
  6. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #6
    Um, not only did I explain magic quotes (well known basic PHP stuff) in my original response I included no less than 3 very specific alternatives to resolve that issue -- even referencing the specific function by name so you know what to look for. You "tried" this? It "failed"? "What is magic quotes" you ask after all that?

    Sigh.

    Yes, the magic quotes is about what you said (as I hinted at, re: database and addslashes which is the function PHP uses to escape the quotes) but if you had to ask about that you're so far beyond your skill level here you need to hire a consultant or find a friend who knows PHP and work these migration issues in the source. Isn't this clear to you by now?

    I've come to the conclusion you don't know diddly about PHP and still don't grasp the context that adjusting source code is required, not php.ini settings.

    -jim
     

Share This Page