I’ve just installed the latest version of Appserv ( 9.3.0 ), which includes:
Apache 2.4.41
PHP 7.3.10
MySQL 8.0.17
phpMyAdmin 4.9.1
I’m using Localhost as my root directory and trying to reuse old files to build a new website, but I’m noticing a problem.
I’m using the include()
function, but there is a problem.
<?php include(file.php); ?>
shows the contents of file.php
, but, if I delete file.php
, it doesn’t give me an error message saying file.php could not be found
. Why is this?
2
Answers
In Windows 10, go to:
Start > Appserv > PHP Edit php.ini
Find line :
display_errors Off
and change todisplay_errors On
Save & Close
Start > AppServ > Apache Restart
Answer to secondly:
include()
on a non-existent file produces an error of typeE_WARNING
. For testing purposes simply add this line of codebefore using an
include()
statement.For production you should avoid displaying any kind of errors. You can register your own error handler with
set_error_handler()
.