can't see errors

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

can't see errors

Post by itsmani1 »

Code: Select all

echo "this is a test<BR />";
fooor(i$=1; $i<4; $i++)
{
 echo $i;
}
when i executes above code on my server it don't asks for the error, infect it don't show anything on the page. when i fix the syntax error it works fine.

any help
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

error display is probably disabled... are you on a shared host?
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

its a dedicated/virtual dedicated server
how can i i enable it?

what if i am on a shared server can i enable it?

thanks
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

Code: Select all

ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);
OR

Code: Select all

error_reporting(E_ALL);
To see all the php.ini values on the shared server, run

Code: Select all

<?php
print_r(ini_get_all());
?>

Cheers,
Dibyendra
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: can't see errors

Post by volka »

Are you kidding?
itsmani1 wrote:echo "this is a test<BR />";
fooor(i$=1; $i<4; $i++)
{
echo $i;
}
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: can't see errors

Post by Luke »

volka wrote:Are you kidding?
itsmani1 wrote:echo "this is a test<BR />";
fooor(i$=1; $i<4; $i++)
{
echo $i;
}
I'm pretty sure he was trying to produce an error... ?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Fatal errors will still not show using ini_set('display_errors', 1) (as per the manual). You will need to enable display_errors in your ini file and restart your server in order to see your errors. Keep in mind that this a potential security risk on a production environment. For testing/development, I always set display_errors to On, but on a production system, it is always off for security.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: can't see errors

Post by volka »

The Ninja Space Goat wrote:
volka wrote:Are you kidding?
itsmani1 wrote:echo "this is a test<BR />";
fooor(i$=1; $i<4; $i++)
{
echo $i;
}
I'm pretty sure he was trying to produce an error... ?
oops, sorry. Was full of prejudices :oops:
Post Reply