dzedward Posted February 12, 2008 Share Posted February 12, 2008 I have 3 php files, all of them created for php4. Well, I've just upgraded to php5, and don't know how to update them. These files were supplied to me, and the company doesn't plan to update them, so I'm s.o.l. Can someone please look at them and see if they can tell me either, a) where to begin, or if its easy enough, tell me what to change. I'll attach them as text files. Thank you in advance to anyone willing. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/ Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 There really isn't allot of difference between php4 and php5 and most differences that there are can be changed via configuration. The only real issues I can see with those small script is $HTTP_GET_VARS needs to be replaced with $_GET in phpbb_login_chat.txt. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-464981 Share on other sites More sharing options...
dzedward Posted February 12, 2008 Author Share Posted February 12, 2008 Thanks for the quick response thorpe. "There really isn't allot of difference between php4 and php5 and most differences that there are can be changed via configuration." Meaning my server config? or php.ini? Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-464985 Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 php.ini. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-464986 Share on other sites More sharing options...
dzedward Posted February 12, 2008 Author Share Posted February 12, 2008 Can you inform me of the changes I should make? The reason I'm asking is, as you can see from the link I'm about to post, it's giving me sql_escape() errors, if I take that out it gives me utf8_clean_string, if I then take that out, I get sql_query error on the next line. That leads me to believe there is some sort of major difference http://flashgods.kicks-ass.net/forums/phpbb_login_chat.php Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-464997 Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 None of the functions you just mentioned are built in php functions. There are numerous configuration changes between php4 and php5, all of which for good reason. There is a section in the manual appendix in migrating, I suggest you go from there. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465002 Share on other sites More sharing options...
dzedward Posted February 12, 2008 Author Share Posted February 12, 2008 Will do, thanks thorpe, very helpful. I'll be back if there are bumps along the way. drinks on me! Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465007 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 Ok, I've worked out the problems with phpbb_login_chat.php, but I can't figure this out in 123flashchat.php Fatal error: Call to a member function session_begin() on a non-object in C:\wamp\www\LiveSupport\client\123flashchat.php on line 32 Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465480 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 That error refers to this line - $user->session_begin(); It means that the object $user does not exist. If we assume that the class and the instance of $user is defined in one of the include files, that would indicate that the include statement(s) are not working. Start by checking your web server log file for errors to see if they pinpoint what is happening. Also, putting the following two lines in after the first opening <?php tag would help in debugging - ini_set ("display_errors", "1"); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465495 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 user is defined in common.php $user = new user(); I check the path for the include, and its right. Also, I don't see anything in the apache error logs about this error. After inserting the code you gave, I got this Notice: Undefined variable: user in C:\wamp\www\LiveSupport\client\123flashchat.php on line 34 Fatal error: Call to a member function session_begin() on a non-object in C:\wamp\www\LiveSupport\client\123flashchat.php on line 34 Should I just instantiate user in that file? Edit: tried instantiating user in that file, got this: Fatal error: Class 'user' not found in C:\wamp\www\LiveSupport\client\123flashchat.php on line 32 Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465506 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 Since this code worked before, there should be no reason to move code around. My guess is that common.php is being included, but it is doing something that is preventing the object from being created and any errors occurring within it from being reported. Post or attach common.php. If you post it, make sure you include any starting/ending php tags so we can see those as well (if code is using a short open tag <? then the code won't necessarily execute, meaning no error messages generated either.) Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465511 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 Here you go [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465515 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 There are two things in that file that could be preventing helpful errors from being reported. Temporarily comment out line 23 - error_reporting(E_ALL ^ E_NOTICE); and line 196 - set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465523 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 Still getting the same error for 123flashchat.php and no error in Apache error logs... Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465536 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 I guess if one file has modified the error reporting, more could have. Is this a phpbb modification that you can provide a link to the author's site so that all the files can be downloaded and examined or is this some custom code? Edit: Nevermind the above question, I found the 123chat web site and downloaded the script. About the only other thing I can suggest is to add the two error reporting lines I posted above (ini_set(...)/error_reporting(...)) in common.php, right before the $user = new user(); statement. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465542 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 http://www.123flashchat.com/download/phpbb_mod_for_123flashchat_6.8.0.zip Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465546 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 Actually I found that, but your script looks to be a heavily modified version. Try my suggestion to add the two error reporting lines right before the $user object is created. If that does not provide any information, then it would take finding out why the code is not executing or why errors are not being generated and reported. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465547 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 The only thing I've modified is the parameters I had to set to connect to my forum and client. Also, the phpbb_login_chat.php file only had <? for opening the php so I changed to <?php, and one other thing, change HTTP_GET_VARS to _GET as per thorpe's suggestion, which cleared that file of all errors. I did what you said, and still, the same error appears... Its like its not executing the require statement?!?? Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465558 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 The file you posted is for 123flashchat 6.7.0. The latest download is 6.8.0. There are significant differences. I will see if I can locate the 6.7.0 files and take a look. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465561 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 O wow, I never noticed that, yea, looks like the 123flashchat.php file is for 6.7... functions_chat.php file says 6.8, and phpbb_login_chat.php doesn't say anything, but its working... Looks like I need the correct version of the 123flashchat.php.. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465564 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 The difference in the code is due to phpbb2 and phpbb3 (the 123flashchat file does not indicate which it was for and I downloaded the first link I found which was for the phpbb2 version.) The files in question that might be either modifying the error reporting or conditionally executing the $user = new user(); statement are part of phpbb. This says that phpbb is being prevented from creating the $user object (or it is getting overwritten.) Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465577 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 hmm, yea, I downloaded the updated version for phpbb3, which is what I'm running, yet, still get the session_begin() error http://flashgods.kicks-ass.net/LiveSupport/client/123flashchat.php I'm just not sure what to do!!! They tell me they won't be releasing a updated php files made for php 5, so they aren't much help. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465581 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 I think it may be my include path for php on my server... As of now, its set to .;c:\wamp\bin\php\php5.2.5 Is this correct? Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465586 Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 The functions_chat.txt (.php) that you attached is not the same version as the other files and it appear to be from the phpbb2 set of files, not the phpbb3 set. While this is probably not directly causing the error, it would play a role. I will continue to look and see if I can see why the $user object is not being created, but please use a consistent set of files. I don't think it is the include path because the error reporting lines should have indicated an error, at least for the first include. You can change the include() statements to require() statement to see if they are failing. Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465605 Share on other sites More sharing options...
dzedward Posted February 13, 2008 Author Share Posted February 13, 2008 I am using all the files from the phpBB3 download zip. I'll re-attach all the files. I did try changing the include to require, however same error.. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/90713-php4-php5/#findComment-465607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.