Page 1 of 1

Deprecated problem because of PHP version (SOLVED)

PostPosted: 06. October 2011 19:22
by LEDFanCDN
OK now I have another problem because PHP version is causing my vbulletin to display error messages.

On my forum I see this (forum loads but with these messages above):
Code: Select all
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 49
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 101
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 105
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 113
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 124
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 128
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 136
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 205
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 383
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\class_core.php on line 2552


and for my admin panel which does not load at all, just the login screen but then just displays the same error messages:
Code: Select all
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 49
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 101
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 105
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 113
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 124
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 128
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 136
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 205
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\init.php on line 383
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\dispo\forum\includes\class_core.php on line 2552

[/code]

I tried modifying the php.ini file

display_errors = On
to
display_errors = OFF

and
error_reporting = E_ALL | E_STRICT
to
error_reporting = E_ALL & ~E_DEPRECATED

but nothing works.

What's my next step? Is there a way to downgrade my PHP version before 5.3 or I need to unistall XAmpp and use version 1.7.0?

Re: Deprecated problem because of PHP version

PostPosted: 06. October 2011 19:23
by Altrea
Do you have restarted Apache after the change in the php.ini?

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 01:14
by LEDFanCDN
Sorry I forgot to say that, yes I did.

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 01:41
by Altrea
Please check the error_reporting level with the phpinfo() function which can be found in your XAMPP Administration page (http://localhost/xampp/)

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 01:58
by LEDFanCDN
OK. I just checked and I have a value of 22527 for both the Local and Master values.

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 02:51
by Altrea
This Value is okay. 22527 is the value for E_ALL & ~E_DEPRECATED

So, two possibilities:
- your site will be sended from your Browsercache. please clear your Browsercache to eliminate this possibility.
- your error_reporting level will be overwritten by a .htaccess rule or a php setting. So, please check your .htaccess files (if any of them exists) and search your sourcecodes for the error_reporting function. Most common this will be used in a very central file like index.php. I recommend to use an editor like Notepad++ to scan the sourcecode of multiple files for that.

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 03:11
by LEDFanCDN
Altrea wrote:So, two possibilities:
- your site will be sended from your Browsercache. please clear your Browsercache to eliminate this possibility.

Cleared all cache and tried with Firefox, Opera, Safari and Chrome; same results

Altrea wrote:- your error_reporting level will be overwritten by a .htaccess rule or a php setting. So, please check your .htaccess files (if any of them exists) and search your sourcecodes for the error_reporting function. Most common this will be used in a very central file like index.php. I recommend to use an editor like Notepad++ to scan the sourcecode of multiple files for that.

I have no .htaccess file as it's a local server only. I only use .htaccess when I put my site online. I used a local site first to test my forum then I move it online.

Could you also give me some answers to my first two questions? Can I use another version of php with Xampp 1.7.7? If so, how do I do this? Finally, if none of these soltuions work, I guess that I should uninstall this version and use 1.7.0, no?

Thanks for your support.

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 03:16
by Sharley
Before resorting to installing an older version try this setting which has helped some users with this problem and may allow you to move forward for now and by the time a new PHP version deprecates this setting, hopefully your scripts author may have cleaned up the code and issued an upgrade:

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

This give just errors not messages.

Same issue with a user selected fix:
viewtopic.php?f=16&t=48404

Best wishes. :)

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 03:28
by LEDFanCDN
Great! This worked, no more error lines are showing on top of my screen and I now can access my Admin Panel!

Many thanks to both of you!

Re: Deprecated problem because of PHP version

PostPosted: 07. October 2011 03:32
by Altrea
That are good news :D
But i would recommend you to clean your code to get rid of the messages completely. Otherwise it will not work with later PHP versions.
Or id thats a script by anyone else in the internet, search for a newer version of it.