Page 1 of 1

error_reporting and CodeLock

Posted: Tue Sep 21, 2004 9:51 pm
by jumpshotjonny
I'm having a problem here, I'm trying to set the error_level to show only errors and parse errors for a PHP application I am working on and some of the files must be encrypted. The encryptor being used is CodeLock(http://www.codelock.co.nz/). The reason I need the error level set to that level is so that the warnings that come up when fsockopen cannot connect to a host are not displayed.

With all of the script files unencrypted everything works fine and no warnings are displayed but once the files that need to be encrypted are encrypted these warnings are displayed and I need to get them removed.

Has anyone had any experience with Codelock? Or have had similar problems as I have?

Codelock makes use of the eval function to execute encrypted code, would code executed with eval have problems using the error level set using the error_reporting function?

Any help anyone can provide would be greatly appreciated.

Posted: Tue Sep 21, 2004 9:54 pm
by feyd
have you tried using the @ operator?

http://www.php.net/manual/en/language.o ... ontrol.php

php.ini

Posted: Wed Sep 22, 2004 2:54 am
by phpScott
look for "Error handling and logging" section in your php.ini file to set error levels and how to display or log them.
The top or the ini file also has a lot of explanation on error reporting/logging.

Posted: Wed Sep 22, 2004 4:57 am
by jumpshotjonny
have you tried using the @ operator?
Gah! I feel like such a dunce. :) The thought just hadn't crossed my mind. That seems to have worked. Thanks!

I can't set the error level in the php.ini file because this application is being distributed so it has to work with a wide variety of configurations. And people tend to get scared when they see those warnings so I needed get rid of them.

Posted: Wed Sep 22, 2004 5:31 am
by timvw
[php_man]ini_set[/php_man]

Posted: Wed Sep 22, 2004 10:10 am
by jumpshotjonny
Actually, I tried ini_set as well but for whatever reason error_reporting and ini_set have no effect when I have the files encrypted. It's really odd but those were the main warnings I couldn't rid of but the @ operator has solved that. Everything else was taken care of by cleaning up the code.