Blank PHP error inside IF statement

Hi everyone,
I’m building a simple system with a Form with EXE Output 2019.1
When a PHP error (or notice) occour, let’s say at the beginning of the page, it is shown in the usual pop-up AND in the Log file wich I’ve activated.

Tha problem is that when the error occours inside the IF statement raltive to data posted by the form, it return no message, even in the log file there is only “PHP ERROR:”

Obviously this make debug really painful.

Any help would be mutch appreciated.
Thanks

Have you enabled PHP error log?

Yes I did but, for the errors inside the IF, I get only “PHP ERROR:”

Can you tell us what code you used for that IF statement?

I’ve created a test program to reproduce the problem.
There is only an index.php file whith this code at the beginning:

//if i generate an error here i can see it
//dummyFunction();

if(isset($_POST['textfield'])){
	//if i generate an error here is blank
	dummyFunction2();
}

and a form like this in the body:

<form id="form1" name="form1" method="post" action="index.php">
	<label>dummy text
		<input type="text" name="textfield" id="textfield" />
	</label>

	<input type="submit" name="button" id="button" value="Submit" />
</form>

If I uncomment the first line I get the error, otherwise if I submit the form I receive a blank error.

Have you enabled the PHP error logging in PHP.ini?

As I said

and I still get a blank error…

That’s not what I meant. PHP has its own logging system that is not captured by ExeOutput. If you get a blank page, this means that PHP had an error and returned nothing. Then, you can capture this error in the PHP error log. You have to configure the PHP.INI to enable that PHP logging.

1 Like

Sorry, I didn’t understand what you meant. :flushed:

I have now, and it worked! I’ve placed those lines in php.ini:

log_errors = on
error_reporting = 32767
error_log = D:\php_error.log

Now the errors appear also on the page just like any normal web server.

Thank you so much!

1 Like

Sorry but seem there is still a problem.
If I deactivate de directive “error_log = D:\php_error.log” in php.ini (leaving the other two intact) or set a non existing path, the original problem is still there.

Now, in my test enviroment, this is not much of a problem but in deploiment it IS since I can’t be sure of a path for error log.

There is at least a way to set some sort of default path in php.ini like HEPubStorageLocation?

Try

error_log = C:\Windows\temp\php_errors.log