I write the site code, check it in the embedded PHP server (php7-cli). Everything was fine, but I began to master MVC , but then it suddenly became clear that the embedded server does not support .htaccess . There is an exit by writing a router and specifying it in the server call parameter, but a problem appears, no errors are output to the terminal . It is almost necessary to write a message before every require_once that the file is connected. Then torture it all clean when publishing a site, tell me the normal solution please.

I need to catch all messages related to the absence:

  1. file
  2. class
  3. method

You need the type of your error handler (of type set_error_handler or set_exception_handler ) of a certain type, but unfortunately there is no time to deal with all this.

Added: issue with terminal "silence" is already resolved

  • What is the mvc framework used for? - Igor
  • and the option to put the Apache + xdebug on a lokalka is not considered? - Dmitry Kozlov
  • see the answer here ru.stackoverflow.com/questions/540612 , and proapditetit question, you need something in the end, if the issue with the silence of the terminal resolved? In addition, you do not need a terminal, you need to set up ini logs and install some kind of log viewer or an analog tail for Windows - strangeqargo
  • @strangeqargo From the fact that the issue with the "silence" of the terminal was solved, the root of the question has not changed. In order not to repeat, starting with the words "I need" the question says what I need. Sorry, but what's the difference where errors are displayed, even in the terminal, even in the logs. But thanks for the advice - tonchikp
  • @Igor Your own, samopisny. Rather, not even a framework, just sticking to the mvc ideology when writing - tonchikp

1 answer 1

I did not understand the question, but so that no error was lost, the server should be configured as follows:

  • On the home server, display on the screen and write to the log

    error_reporting(E_ALL); ini_set('display_errors', 1); ini_set('log_errors', 1); 
  • On the battle server, block the output to the screen and write to the log

     error_reporting(E_ALL); ini_set('display_errors', 0); ini_set('log_errors', 1); 
  • This is already done in the base file that requires_once is connected. It does not help, errors are not displayed, in general - tonchikp
  • @ Ipatiev How? @ - I don't use anywhere else - tonchikp