Forum Moderators: coopster

Message Too Old, No Replies

Upgraded to 4.3.10 = Errors galore for my scripts. They still work

Undefined offset, Undefined variable, Constant already defined etc.

         

walkman

10:43 pm on Mar 27, 2005 (gmt 0)



---------
Fedora Core 2
Apache 2.0.51
PHP 4.3.10 (cgi) (built: *** ** 2004 **:**:**)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.6, Copyright (c) 2003-2004, by Zend Technologies
with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend Technologies
------------
I got a new server, Apache 2.0+, and this one has php 4.3.10. I have an old php nuke site and now a brand new php based site but both have major errors (when I tunr the error reporting on or error log). I had to turn register_globals = On, which I understand is not ideal, but the errors bother me. Php-nuke is old so I that's OK I guess.
here's a sample of the errors:

Notice: Undefined offset:
Notice: Undefined variable: PHP_SELF
Notice: Undefined variable: op
Notice: Use of undefined constant userbox - assumed 'userbox'
Notice: Constant _LOGINCREATE already defined
Notice: Undefined variable: REMOTE_ADDR
Undefined offset: 3
Notice: Undefined offset: 323
---------
A few questions (sorry):
1. is there anything I can do on the php.ini to nullify these errors?
2. Do these errors matter (in terms of performance, security)? The server is very powerful and can draw a page within 0.0x seconds even if 500+ people are online.

3. Can these be fixed? Do I ask the programmer to take another look? What will happen if I install 4.3.11 or 5.0? is there a safe way to program (minimal /standard features), so the script still works?
4. My   (spaces) are showing as? (question marks). Is that a php or apache thing? How do I fix it?

sorry for all the questions, and any help is greatly appreciated,

Thanks again,

---------added----------
On another server I have no errors at all. Could it be the Zend version, cli vs cgi...?
PHP 4.3.8 (cli) (built: Aug 1 2004 14:08:21)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with the ionCube PHP Accelerator v1.3.3r2, Copyright (c) 2001-2002, by Nick Lindridge

dreamcatcher

11:17 pm on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, you could switch error reporting off:

error_reporting(0);

however:

Do I ask the programmer to take another look?

Yes. Especially if you have paid him/her. A few issets here and there might do the trick.

:)

walkman

11:46 pm on Mar 27, 2005 (gmt 0)



Hi dreamcatcher,
thanks for the answer. I turned it off now but still rather fix this.

would installing php again (not by rpm this time) fix any of these errors or..? I'm trying to figure out why I had no errors on the other server. The reporting and logging were on there too, yet no errors.

4.3.8 (cli) no errors (fedora too)
PHP 4.3.10 (cgi) + Zend Extension Manager v1.0.6,+Zend Optimizer v2.5.7 plenty of errors

mincklerstraat

6:07 am on Mar 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



These are all 'notice' errors and not the type that are going to be different from php version to php version. Most likely your php.ini file has the default error reporting level set to be E_ALL on your current server, while it was E_WARNING or on the other one (if you had error reporting on with that one). If you still have access to the old server, try putting 'error_reporting(E_ALL);' near the top of the script, and you'll probably get these same errors. A different install of php won't help here, dreamcatcher's right-on, I think.

walkman

6:47 am on Mar 28, 2005 (gmt 0)



Hi mincklerstraat,
that could be it. I had three telnet sessions going on, after 12 hours stuck in the chair so I maybe I read incorrectly the report error settings. In a sense, I'm glad it's not the server, I rather keep it simple and be able update via yum...

For now I disabled the warnings, but if he replaces the variables that cause the errors, I should be fine, correect? Will new problems appear again on the next php update?

thanks again,

walkman

8:13 am on Mar 28, 2005 (gmt 0)



The spaces converting to? has been solved by # /commenting out the
AddDefaultCharset UTF-8
line on httpd.conf. Hope it helps someone

mincklerstraat

12:37 am on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't know about the spaces problem --

Your programmer is probably used to programing without E_NOTICE errors showing. This is not such a big deal. Some of the most popular scripts out there, like phpBB2, will show E_NOTICE errors if you remove their native error handling - I haven't tested so many scripts, but all of the really popular scripts I've tested so far show E_NOTICE errors here and there. So your programmer is definitely not alone - this is probably the norm. The norm [i]should]/i] be programming without E_NOTICE errors, but unfortunately this isn't the case.

Yes, if you just set error handling to zero, with future PHP updates, these shouldn't show. That's how PHP is configured.

walkman

2:00 am on Mar 29, 2005 (gmt 0)



thanks again, I will mention it to him and ask if he can fix them, just in case.

when I update php again, via yum, will my preferences be saved or do I have to edit them again?