FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » way to turn off strict option? Use of undefined constant
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: way to turn off strict option? Use of undefined constant [message #177146 is a reply to message #177142] Thu, 23 February 2012 18:00 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 23/02/2012 17:01, Paul escribió/wrote:
> I installed a new version of PHP and now am getting errors on my pages
> that say:
>
> Notice: Use of undefined constant....
>
> Is there any way in the page that I can add some code so I do not get
> these errors? I just want to get this working and will go back and
> fix this later.
>
> But maybe there is a way like in VB a way to turn off Option
> Explicit ?

Not exactly, but quite similar. You have a few choices:

- Hide error messages:
http://es2.php.net/manual/en/errorfunc.configuration.php#ini.display-errors

- Log error messages:
http://es2.php.net/manual/en/errorfunc.configuration.php#ini.error-log

- Ignore certain error types:
http://es2.php.net/manual/en/errorfunc.configuration.php#ini.error-reportin g

These options can be combined to your liking. You can set them in
several places:

1. Edit your `php.ini` file:

error_reporting = E_ALL & ~E_NOTICE
display_errors = On

2. Put this on top of your script:

<?php

error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', TRUE);

3. If PHP runs as Apache module, you can also use an `.htaccess` file:

# Print E_ALL & ~E_NOTICE from a PHP script to get the appropriate number:
php_value error_reporting 30711
php_flag display_errors on


In your dev box I'd recommend E_ALL | E_STRICT.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: PHP Version 5.3.6
Next Topic: Accessing IIS variables from PHP after URL Rewrite
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 10:38:21 GMT 2024

Total time taken to generate the page: 0.04115 seconds