1

I have apache2 installed on my PC. And php5 and all the stuffs. The php is also running fine. I checked commands INSERT INTO myTable etc and it's working fine. I've phpMyAdmin installed and it's also working fine. The problem is that I'm not getting any error when there is actually error. for e.g. PHP :

<?php
  <?php
  $umair = 1

  echo $umair;
  echo 'asdf';
?>

This code isn't outputting anything. As you can see there is error of semicolon here and the PHP must show some error. And if I put the semicolon then the PHP runs as usual and get the output 1asdf

omerjerk
  • 4,090
  • 5
  • 40
  • 57

3 Answers3

1

Set your php.ini settings to display errors :

- error_reporting to E_ALL
- display_errors to on

(those are developement environment settings of course ; more about error_reporting levels here)

You can find your php.ini location using phpinfo() in a PHP script.

EDIT In case it isn't that, try to execute a valid script, and tell us if it runs correctly. If it doesn't, it probably means that your php module installation failed somehow.

EDIT 2 Restarting Apache will be necessary after editing such parameters.

John WH Smith
  • 2,743
  • 1
  • 21
  • 31
0

You can try to show the errors for the current file that you're working on right now by adding

error_reporting(E_ALL);

and try to check this

Community
  • 1
  • 1
Programmer4me
  • 99
  • 1
  • 6
0

The problem is that the missing ";" is a parser error - and parsing is done before execution. PHP will simply not even start executing an invalid script - so you don't see anything.

Try to include this script in another script and run that - then you will get a clear error-msg!

Here's more on that topic and also my script to do this: How to get useful error messages in PHP?

Community
  • 1
  • 1
MBaas
  • 7,248
  • 6
  • 44
  • 61