NameSilo

Register_globals and display_errors

SpaceshipSpaceship
Watch

Porte

VIP Member
Impact
145
Hello,

quick question regarding the php configuration. Is there a way to change these options using the ini_set() ? I know its possible to do error_reporting(VALUE) but some times display_errors are off.

Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Anyone?
 
0
•••
why not look at http://php.net/ini_set

But the answer the question, you can. But only temp. When i say "temp" it will only happen when the script is running... and after that, it goes back to the normal setting in php.ini
 
0
•••
do not bother setting register_globals in a script by the time the script is executed the work has been done.

You should be able to set that in a htaccess file instead, doing it there will make that setting active to any script within that folder BEFORE the script runs so will have an effect.
 
0
•••
Yes, i needed to do it within the script itself for some reason during execution. How would a proper example look like?

ini_set("display_errors",1);
ini_set("register_globals",1);

Would this produce what I need?

Just tested..it didn't affect the script, still doesn't show errors because display errors are off in the .ini file.
 
0
•••
setting register globals to on inside a script will not affect the script at all and is useless. Register Globals affects variables etc BEFORE a script is started.

regarding the errors 1 look at http://uk2.php.net/error-reporting
 
0
•••
Yes, I've looked there. I just tried to set it in the script since axilant has said I am able to change this at runtime.

Forget register_globals, can I do this [ ini_set('display_errors', 1); but It didn't affect my script also? ]
 
0
•••
I presume if your error_reporting level is too low then it wont matter what display_errors is set too.

Also it is possible that your host has blocked users from chaning settings in this way.
 
0
•••
So this function ini_set() in other words, is useless?
 
0
•••
Contact your host, and if they have blocked you from altering the INI settings (which they probably did), then yes, it's useless.
 
0
•••
The point here is that I am writing a script which should be used by some people, so I want to take in consideration that every user will have different php configuration that's why I have asked about these 2 important settings. but then I found that using error_reporting(0) would be the best as of now.
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back