Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
testy1
Involved
Involved



Joined: Apr 06, 2008
Posts: 484

PostPosted: Tue Oct 27, 2009 5:32 pm Reply with quote

Some errors and assorted for future reference.

Currently using php 5.3 and thought I would log some of the errors.



Deprecated: Assigning the return value of new by reference is deprecated in includes\xmlrpc\xmlrpc.php on line 554

Fixed these errors using the following function, although probably not the best way :(


Code:
function & rn_newref(&$new_value) { 

  return $new_value;
}



then for example find:
Code:


$client =& new xmlrpc_client('/version.php', 'nukeseo.com', 80);


Change To:
Code:


$client =& rn_newref(new xmlrpc_client('/version.php', 'nukeseo.com', 80));




Error: Function split() is deprecated in includes\xmlrpc\xmlrpc.php on line 2272

Find:
Code:
$ar = split("\r?\n", trim(substr($data, 0, $pos)));


Change To:
Code:


$ar = explode("\r?\n", trim(substr($data, 0, $pos)));




Other Errors:

All ereg need to be replaced

Code:


ereg()
ereg_replace()



Link:
Code:
admin.php?op=ABTrackedAgentsPages&tid=1

Notice: Undefined variable: perpage in admin\modules\nukesentinel\ABTrackedAgentsPages.php on line 23
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Tue Oct 27, 2009 5:52 pm Reply with quote

Those deprecated warnings in php 5.3 are known. They are still fully supported in php 5.3 and will be up until php 6. They will all be addressed well before php 6 is released. To remove them for testing purposes, in rnconfig.php find
Code:
$error_reporting = E_ALL^E_NOTICE;
and replace with
Code:
$error_reporting = E_ALL^E_NOTICE^E_DEPRECATED;
and that will suppress the reporting of deprecated errors.

EDIT: also the best way to handle the deprecated split and ereg will be with the Perl-compatible preg family IMO.

_________________
Only registered users can see links on this board! Get registered or login!

Last edited by nuken on Tue Nov 03, 2009 6:26 pm; edited 1 time in total 
View user's profile Send private message Send e-mail Visit poster's website
testy1







PostPosted: Tue Oct 27, 2009 9:09 pm Reply with quote

nuken wrote:
Those depreciated warnings in php 5.3 are known. They are still fully supported in php 5.3 and will be up until php 6. They will all be addressed well before php 6 is released. To remove them for testing purposes, in rnconfig.php find
Code:
$error_reporting = E_ALL^E_NOTICE;
and replace with
Code:
$error_reporting = E_ALL^E_NOTICE^E_DEPRECATED;
and that will suppress the reporting of depreciated errors.

EDIT: also the best way to handle the depreciated split and ereg will be with the Perl-compatible preg family IMO.


I understand its just a notice basically but ultimately it should be fixed.Well thats the way I code anyway.Just thought I'd post it up for future reference.I always thought explode was faster unless you specifically needed to use regex.
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Oct 28, 2009 12:23 am Reply with quote

Thanks Testy1 Smile. Btw, Explode carries some security issues if not handled just right.

Nuken: You are correct and we should probably add $error_reporting = E_ALL^E_NOTICE^E_DEPRECATED; as our default. Please enter a Mantis issue on this and mark it for v2.40.01 . Thanks!


Last edited by Raven on Wed Oct 28, 2009 6:25 pm; edited 1 time in total 
View user's profile Send private message
nuken







PostPosted: Wed Oct 28, 2009 9:36 am Reply with quote

Done
 
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Wed Oct 28, 2009 5:50 pm Reply with quote

Raven wrote:
Please enter a Mantis issue on this and mark it for v2.30.01 . Thanks!

yey retroactive fix Smile

nah just kidding it's late and I've been fiddling with 5.3 tonight , getting on my nerves.

Btw , I didn't get how you cloned split()

_________________
Only registered users can see links on this board! Get registered or login! (My RN site)- Only registered users can see links on this board! Get registered or login!(cod4 clan) - Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website MSN Messenger
Raven







PostPosted: Wed Oct 28, 2009 6:27 pm Reply with quote

Thanks for the catch killing me
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Oct 31, 2009 9:05 am Reply with quote

This is assigned to me and this is how I intend to implement and would like some testing by Testy1 as I do not have 5.3 nor the time ATM to install it:

Code:


$error_reporting = E_ALL^E_NOTICE; // This is the default and means: All errors except Notices
if (defined('E_DEPRECATED')) $error_reporting = $error_reporting^E_DEPRECATED; // If want to see these warnings when running PHP5.3, comment out this IF statement


I am still needing to hunt down the constant value so that I can place it in the comments above.

Let me know how this works. It will gracefully degrade for lower PHP's which do not have that constant defined.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
eldorado







PostPosted: Sat Oct 31, 2009 5:59 pm Reply with quote

huhm....? I'll test this Smile
 
testy1







PostPosted: Sat Oct 31, 2009 9:54 pm Reply with quote

As a quick note; I have used xampp on my windows box for about 3 years, but recently decided to try wamp.It allows me to easily install the multiple versions of php, mysql, apache (including beta versions) with a quick automated install.and at the click of a button it restarts the server with a different version.I wont be going back to xampp Smile


Ok some testing;

My Version Info

Apache: 2.2.13
PHP: 5.3.0
MySQL: 5.1.36

With a default install of ravennuke 2.4 it displays the following errors at the top of the page

Code:


Deprecated: Function set_magic_quotes_runtime() is deprecated in E:\wamp\www\raven\rnconfig.php on line 267

Deprecated: Function ereg() is deprecated in E:\wamp\www\raven\includes\ipban.php on line 22

Deprecated: Function eregi() is deprecated in E:\wamp\www\raven\modules\Your_Account\includes\mainfileend.php on line 17

Deprecated: Function eregi() is deprecated in E:\wamp\www\raven\modules\Your_Account\includes\constants.php on line 17



After making suggested changes in rnconfig.php I get the following error still.

Code:


Deprecated: Function set_magic_quotes_runtime() is deprecated in E:\wamp\www\raven\rnconfig.php on line 267


so it seems that there also needs to be a php version check to the new ini setting at the bottom of rnconfig.php

Note: It also displays all the errors once you comment out your changes.Also the changes you suggested seem to work fine in php version 5.2.11.


Some other test's I did for further info if needed....

Apache: 2.2.13
PHP: 5.2.11
MySQL: 5.1.36

Quote:

Test 1
Code:


$error_reporting = E_ALL;


The above outputs

Code:


int(6134)


Test 2
Code:


$error_reporting = E_NOTICE;


The above outputs

Code:


int(8)


Test 3
Code:


$error_reporting = E_STRICT;


The above outputs

Code:


int(2048)



Test 4
Code:


$error_reporting = E_ALL^E_NOTICE;


The above outputs

Code:


int(6135)




Apache: 2.2.13
PHP: 5.3.0
MySQL: 5.1.36

Quote:

Test 1
Code:


$error_reporting = E_ALL;


The above outputs

Code:


int(30719)


Test 2
Code:


$error_reporting = E_NOTICE;


The above outputs

Code:


int(8)


Test 3
Code:


$error_reporting = E_STRICT;


The above outputs

Code:


int(2048)



Test 4
Code:


$error_reporting = E_ALL^E_NOTICE;


The above outputs

Code:


int(30711)



Test 5
Code:


$error_reporting = E_DEPRECATED;


The above outputs

Code:


int(8192)

 
montego







PostPosted: Tue Nov 03, 2009 6:43 am Reply with quote

testy1, this is excellent info... I did manage to find the constant values. That is a real PITA about the other error and THANKS for letting me know that!

The reason for that is the error level isn't actually set until further down in mainfile.php which is why the warning is still be shown. I don't think I can just move that, which would be the ideal. I'll look into it.

Thanks again m8!
 
testy1







PostPosted: Tue Nov 03, 2009 4:03 pm Reply with quote

just moving it sounds way to easy lol,

Good rule of thumb is if you have 1 hour spare it will take at least 4 hours Smile
 
Unit1
Worker
Worker



Joined: Oct 26, 2004
Posts: 134
Location: Boston

PostPosted: Tue Nov 03, 2009 4:39 pm Reply with quote

testy1 wrote:
just moving it sounds way to easy lol,

Good rule of thumb is if you have 1 hour spare it will take at least 4 hours Smile


So True Laughing

_________________
* 5 Simple rules to be happy: * Free Your Heart from Hatred * Free Your Mind from Worries * Live Simply * Give More * Expect Less. 
View user's profile Send private message
silicastorm
New Member
New Member



Joined: Jan 15, 2010
Posts: 22
Location: Abu Dhabi, UAE

PostPosted: Wed Jan 27, 2010 10:18 pm Reply with quote

Good Day,

Currently in production server running phpnuke 8.0 + Nuke Sentinal 2.6.01 and combined with the bbantispam has stabilized the site from intrusions.

Now starting a migration with a complete new install of RN in a test environment.

In Windose platform with XAMPP 1.7.3 I was able to complete the installation without issue to "Install RavenNuke Tables" - with no issue.

Now attempting to access admin.php and recieve the following error:

Quote:
Deprecated: Function ereg() is deprecated in C:\xampp\htdocs\dspx360\includes\ipban.php on line 22


Followed Montego suggestion to edit rnconfig.php

Code:
$error_reporting = E_ALL^E_NOTICE; // This is the default and means: All errors except Notices

if (defined('E_DEPRECATED')) $error_reporting = $error_reporting^E_DEPRECATED; // If want to see these warnings when running PHP5.3, comment out this IF statement


but now only a white page with the comical "Nice Try"

Let me know if I have missed something,

_________________
http://www.xbox360project.com 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Thu Jan 28, 2010 2:35 am Reply with quote

Check your server log and/or PHP log for errors.
 
Raven







PostPosted: Thu Jan 28, 2010 2:38 am Reply with quote

Adding to Testy1's observations, you can get a full list of the numerics at http://us3.php.net/manual/en/errorfunc.constants.php . Then to combine settings just do the math Wink
 
silicastorm







PostPosted: Thu Jan 28, 2010 10:15 am Reply with quote

This is the Apache Error Log:

Quote:
[Thu Jan 28 20:09:44 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Jan 28 20:09:44 2010] [notice] Digest: done
[Thu Jan 28 20:09:44 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Jan 28 20:09:44 2010] [notice] Server built: Nov 11 2009 14:29:03
[Thu Jan 28 20:09:44 2010] [notice] Parent: Created child process 2164
[Thu Jan 28 20:09:46 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Jan 28 20:09:46 2010] [notice] Digest: done
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Child process is running
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Acquired the start mutex.
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Starting 150 worker threads.
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Starting thread to listen on port 80.
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Starting thread to listen on port 443.
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Starting thread to listen on port 80.
[Thu Jan 28 20:09:46 2010] [notice] Child 2164: Starting thread to listen on port 443.


@ Raven: sorry but I have no idea what math you want me to do...

Quote:
Then to combine settings just do the math Wink
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Jan 28, 2010 11:29 am Reply with quote

Try changing it to just this

Code:


$error_reporting = E_ALL^E_NOTICE^E_DEPRECATED;

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Palbin







PostPosted: Thu Jan 28, 2010 11:32 am Reply with quote

montego wrote:
This is assigned to me and this is how I intend to implement and would like some testing by Testy1 as I do not have 5.3 nor the time ATM to install it:

Code:


$error_reporting = E_ALL^E_NOTICE; // This is the default and means: All errors except Notices
if (defined('E_DEPRECATED')) $error_reporting = $error_reporting^E_DEPRECATED; // If want to see these warnings when running PHP5.3, comment out this IF statement


I am still needing to hunt down the constant value so that I can place it in the comments above.

Let me know how this works. It will gracefully degrade for lower PHP's which do not have that constant defined.


Montego, I don't have 5.3 either, but wouldn't it have to be this?
if (defined('E_DEPRECATED')) $error_reporting = $error_reporting . ^E_DEPRECATED;
 
silicastorm







PostPosted: Thu Jan 28, 2010 11:50 am Reply with quote

Ok made the suggested revision and returned the following error:

Quote:
Parse error: syntax error, unexpected '^' in C:\xampp\htdocs\dspx360\rnconfig.php on line 83


Thanks for your help guys,,, is this because I am using XAMPP with PHP 5.3.1 ?

Should I find an old version of XAMPP to install?

Didn't expect to have issues this early in the install.... sorry to bother you guys with this as it is only a test environment.
 
Palbin







PostPosted: Thu Jan 28, 2010 1:02 pm Reply with quote

Replace everything you have done with simply this:

Code:


$error_reporting = E_ALL^E_NOTICE^E_DEPRECATED;
 
silicastorm







PostPosted: Thu Jan 28, 2010 1:24 pm Reply with quote

Right back to the same error in the beginning: White Page "Nice Try"
 
montego







PostPosted: Fri Jan 29, 2010 7:00 am Reply with quote

silicastorm, I believe you have gotten past the PHP errors and are now running into a situation where you are trying to do something that RN's code does not like. So, one issue down and now on to the next.

I have searched through my library of 2.30.00 and 2.40.00 distributions and I cannot find "Nice Try" as text within the code. I know it has to be there, so my searches are failing me. Unfortunately, I have to get moving to get to work... I'll try this again tonight if no-one beats me to it.

Palbin, per your question here

Code:


Montego, I don't have 5.3 either, but wouldn't it have to be this?
if (defined('E_DEPRECATED')) $error_reporting = $error_reporting . ^E_DEPRECATED;


The answer is that $error_reporting is NOT a string, therefore, we don't concatenate it. We're trying to adjust the final integer value that is holds to include the removal of deprecated warnings.
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Fri Jan 29, 2010 7:40 am Reply with quote

this is in includes/ipban.php

Code:
$ip = $_SERVER['REMOTE_ADDR'];

if(!ereg('^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$', $ip)) die('Nice try!!');


I think your problem may be related to your XAMPP and/or test sever setup
 
View user's profile Send private message Visit poster's website
silicastorm







PostPosted: Fri Jan 29, 2010 9:02 pm Reply with quote

Ok, thanks everyone,,,

1) now uninstalling XAMPP
2) installed Wamp Server
a. activated "rewrite_module" - Apache
b. using PHP 5.2.9
c. activated PHP "magic quotes gpc"

Recieve this error at top of page: (No more white blank page) can see CMS

Quote:
Notice: Use of undefined constant E_DEPRECATED - assumed 'E_DEPRECATED' in C:\wamp\www\dspx360\rnconfig.php on line 82

Quote:



And this is line 82:

Code:
*********************************************************************************/

$error_reporting = E_ALL^E_NOTICE^E_DEPRECATED; 
/*********************************************************************************
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©