I'm a total newb.

We are at php 4.4.9 and are being moved to php 5.3.19.

Once I hit the upgrade button on my CP... I have the following errors and wish to fix them as there is zero support from the server administration.

I know how to navigate through the control panel, but have no idea on how to get to these files below.

I'm assuming I go through file manager, then I can drill down and get all the way to the includes folder, but don't see an init file and even if I found it, I don't know what to do to change it so that this is fixed.

Am I looking in the wrong place? Once I find the files, I'll need help in knowing what to change them to please.

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 49

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 101

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 105

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 113

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 124

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 128

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 136

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 205

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/init.php on line 383

Deprecated: Assigning the return value of new by reference is deprecated in /home/motosout/public_html/forums/includes/class_core.php on line 2529

Unable to add cookies, header already sent.
File: /home/motosout/public_html/forums/includes/init.php
Line: 49

    Given that you're going to be looking at a lot of these, for now I would find your server's PHP.ini file and set error_reporting to something that doesn't include E_DEPRECATED:

    php.ini wrote:

    error_reporting = E_ALL & ~E_DEPRECATED

    If you don't have access to php.ini (shared hosting?), then you'll need to do this at runtime in your scripts:

    error_reporting(E_ALL & ~E_DEPRECATED);

    Note that your scripts may not want/be optimized for E_ALL (I'm kind of doubting as you've encountered the errors above); you can adjust the parameters as necessary. The tilde is the NOT operator in this syntax.

    HTH,

      And then, obviously, at some point, you need to have your software upgraded. 😉

        dalecosp;11021389 wrote:

        Given that you're going to be looking at a lot of these, for now I would find your server's PHP.ini file and set error_reporting to something that doesn't include E_DEPRECATED:

        If you don't have access to php.ini (shared hosting?), then you'll need to do this at runtime in your scripts:

        error_reporting(E_ALL & ~E_DEPRECATED);

        Note that your scripts may not want/be optimized for E_ALL (I'm kind of doubting as you've encountered the errors above); you can adjust the parameters as necessary. The tilde is the NOT operator in this syntax.

        HTH,

        Sorry to say.. this is all above my head. I took over as administrator of this forum. I do not have my own server and I think this forum is piggybacking off of someone elses web hosting account. That person is of very little help too. I click on the support and it goes to him and not the webhosting service.

        I just did setup web disk and now I can find the php.ini file that I opened in wordpad. What's next? 😉

        I'm lost on your direction on "do this at runtime in your scripts".

          Well.. the php.ini file I have found is for vbulletin.

            jbomx363;11021403 wrote:

            Well.. the php.ini file I have found is for vbulletin.

            Hmm. I don't remember vB having a php.ini file ... are you quite sure? My 4.2 installs don't, anyhow. Perhaps you have a 3.x?

            jbomx363;11021403 wrote:

            I'm lost on your direction to "do this at runtime in your scripts".

            You could add the line of code to the top of whatever script is producing the errored output (index.php, forum.php ... is this a vB?) That should cause the PHP engine to quit complaining about your old code.

              Wish I could edit my posts!

              Anyway..

              This is what is on the "forums" index file:

              // ####################### SET PHP ENVIRONMENT ###########################
              error_reporting(E_ALL & ~E_NOTICE);

              So all I need to do is change E-NOTICE to E_DEPRECATED

              ?

                You probably just want to ignore the deprecated ones in addition to notices, at least until some point in time when you can upgrade your now extremely out-of-date vBulletin install. So, just add a '& ~E_DEPRECATED' rather than replacing anything.

                What's more, you really shouldn't even have display_errors set to On in your production environment - that setting should be reserved for your development environment (which, I'm guessing, is nonexistent). For the production environment, you should have display_errors set to Off and log_errors set to On.

                  Brad, not certain, but I think that older vB had it set that way and then handled all their own exceptions with native code.

                  jbomx, he's right; the code will now look like:

                  error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

                    Okay. So I'll add that and then I just upload the new index.php file?

                    What's more, you really shouldn't even have display_errors set to On in your production environment - that setting should be reserved for your development environment (which, I'm guessing, is nonexistent). For the production environment, you should have display_errors set to Off and log_errors set to On.

                    Where do I find this to change?

                      jbomx363;11021417 wrote:

                      Okay. So I'll add that and then I just upload the new index.php file?

                      Yes.

                      Where do I find this to change?

                      (In the same place.) But I wouldn't worry about it at present. If you mess with your code too much, you'll get little help from the vB people. Of course, if you're on 3.8, probably most of the stuff you get from them is "upgrade to 4.X please" stuff anyways....

                        Uh oh..

                        I did replace the index.php file on the "home" page and now get:

                        I replaced the new file with the old index file and am still getting the below error. I haven't changed the forums index php file yet until this one is resolved.

                        Internal Server Error

                        The server encountered an internal error or misconfiguration and was unable to complete your request.

                        Please contact the server administrator, webmaster@motosouth.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

                        More information about this error may be available in the server error log.

                        Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

                          jbomx363;11021423 wrote:

                          Uh oh..

                          I did replace the index.php file on the "home" page and now get:

                          Replaced it with what? Your edited version? Was the error_reporting parameter the only thing that changed? Please c'n'p the section of the index file that you replaced here in [noparse]

                          [/noparse] tags. Also, if your server has log files, check the error log (error_log?) and it should tell you/us what error it is.

                          No reason for alarm ... most likely something is fat-fingered in the code that was changed. That, or we told you to do something that's not possible. This, for example:

                          <?php
                          
                          error_reporting('E_ALL & ~E_DEPRECATED & ~E_NOTICE');
                          
                          echo "foo";
                          

                          parses just fine. 🙂

                            However...

                            Once I click on a topic in the forums... I get this:

                            Unable to add cookies, header already sent.
                            File: /home/motosout/public_html/forums/includes/init.php
                            Line: 49

                              Sorry.. really wish you could edit your own posts here!

                              Anyway... I did find the init.php file! So I'm guessing need to start editing that file?

                                Okay....

                                I updated vbulletin and now have upgraded to php5.3.19

                                The deprecated errors are gone on the "forums" part.

                                http://www.motosouth.com/forums/index.php?

                                I am using exactly what the VB updated the index file error reporting to:

                                (E_ALL & ~E_NOTICE & ~8192)

                                However, I'm still getting the below on the "home" part, there was no VB update to that index file. Should I use the same exact index file for both locations or ??

                                http://www.motosouth.com/index.php

                                I did find the init.php file.

                                  And.. my photo gallery also gets the deprecated errors.

                                  http://www.motosouth.com/photopost/index.php

                                  I tried adding in the error_reporting line to this index, but still get the errors.

                                  I see the 2 pages where I have the deprecated errors are missing the ? after the php like the others.

                                  As in..the above is just index.php but more forum page with no error has index.php?

                                  How do I add a question mark if this is the issue?

                                  Doing a rundown of the errors now listed in the init.php file...... most are of this and some type of variant of it involving vbulletin:

                                  $db =& new vB_Database_MySQLi($vbulletin

                                  And this is the only one for the class_core php file:

                                  $this->noheader = defined('NOHEADER') ? true : false;

                                    jbomx363;11021441 wrote:

                                    Doing a rundown of the errors now listed in the init.php file...... most are of this and some type of variant of it involving vbulletin:

                                    That's the cause of the warning; the ampersand after the equals sign, before the keyword "new" is saying to assign the object to the $db variable by reference.

                                    I have no idea, off the top of my head, if removing that "&" will fix the issue. It would remove this particular error, but might possibly cause others. If you try that, you should keep very careful track of exactly what you changed, so you can put it back like it was.

                                    The best idea would be to upgrade the photopost plugin, I think. (Is it indeed a plugin? I don't have a "photopost" in any of my vB installations).