1

I have a php script with a few errors in. It's impossible to debug since its not showing me the errors!!

I tried:

my first line in my script contains following:

   <?php  ini_set('display_errors',1); error_reporting(E_ALL); ?>

but its still not giving me any errors, anyone?

/home/cpeasyapache/src/php-4.4.9/php.ini-dist
/home/cpeasyapache/src/php-4.4.9/php.ini-recommended
/home/cpeasyapache/src/php-5.2.12/php.ini-dist
/home/cpeasyapache/src/php-5.2.12/php.ini-recommended
/scripts/php.ini
/usr/lib/php.ini
/usr/local/cpanel/3rdparty/etc/php.ini
/usr/local/cpanel/3rdparty/etc/php.ini,v
/usr/local/cpanel/3rdparty/etc/php.ini.dist
/usr/local/cpanel/3rdparty/etc/php.ini.keep
/usr/local/cpanel/3rdparty/etc/horde/php.ini
/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
/usr/local/cpanel/3rdparty/etc/phppgadmin/php.ini
/usr/local/cpanel/3rdparty/etc/roundcube/php.ini
/usr/local/lib/php.ini
/usr/local/lib/php.ini,v
/usr/local/lib/php.ini-zend_optimizer.bak
/usr/local/php4/lib/php.ini
/usr/local/php4/lib/php.ini,v
/usr/local/php4/lib/php.ini-zend_optimizer.bak
/usr/php4/lib/php.ini
/var/cpanel/3rdparty/lib/php.ini
/var/cpanel/3rdparty/lib/php.ini,v

there are numerous php.ini files, how do I know which one is the one I need to edit?

3
  • Have you checked to see whether your environment allows you to set those values? Some hosts will not let you override those settings for security purposes. You're better off testing on a local PHP server with XDebug. Commented Jul 15, 2010 at 0:27
  • I am the owner of the VPS, I have access to php.ini, how do I set it there? Commented Jul 15, 2010 at 0:31
  • 1
    If your PHP script contains a parse error, it doesn't matter that you try to set the "display_errors" value on at the top, because your script doesn't parse. Try running php from the command line or setting Display_Errors globally. Commented Jul 15, 2010 at 0:45

1 Answer 1

3

If you are hosted somewhere (meaning you do not own and operate the server), contact thier support and have them add

display_errors = On

to the php.ini file. Then you can use

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

If you are running it yourself, simply make the changes and give it a try.

Sign up to request clarification or add additional context in comments.

2 Comments

i changed my question, please take a look and see if you can locate what file I need to add that line to?
I believe if you run the phpinfo() it will tell you where it is loading it's environment from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.