Link to home
Start Free TrialLog in
Avatar of MICHAEL HOGGATT
MICHAEL HOGGATT

asked on

PHP erro line number display

I place  these instructions at the beginning of my PHP code -

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

if I run actual PHP code and there is an error I get a 500 internal server error instead of the actual line numbers in the code where the error occurred.

Is there something in php.ini that needs to be set also?

Michael
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

A server 500 error means there is something going wrong before it gets to your PHP code.
Avatar of MICHAEL HOGGATT
MICHAEL HOGGATT

ASKER

Hello Julian,
there is quite a bit of PHP code executed before it gets to the 500 error.
So I would think the line number   were the error occurred with display first.
Would this not be the case?

Michael
How do you know the PHP code is running if there is no output?
Have you checked the log files for the HTTP server to see if there are any errors reported there?
I have been out of the programming business for quite a while now.
I only have this one PHP program that I need to run for my application.

Where do I find the log files for PHP ?

Michael
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
here is what the law said -

[26-Jun-2017 20:42:51 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\iis express\PHP\v7.1\ext\php_mysql.dll' - The specified module could not be found.
 in Unknown on line 0
does this mean I need to install a database?

Michael
I downloaded MySQL for Windows but I'm getting the same error.
Will I have to reinstall PHP so it knows
the database is there?

Michael
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the file I have is php_mysqli.dll

Did I install the right database?
If I didn't, where do I find the right one?

Michael
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is odd because mysql library has been deprecated and removed from PHP 7 - so why is your installation trying to reference it?

The mysqli version is the right one - just interested to know how the mysql library even got in there.
I have followed your recommendations in the above and I'm still getting the same error message.

The code I am running doesn't seem to use a database so could there be some settings in php.ini that would affect startup?

Would there be any reason for me to uninstall php and reinstall it now that I have added the database?

Michael
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thenks guys,

Every thing is working fine now.

Michael