Hello, found the function

error_log("Error message\n", 3, "/path/php.log"); 

where $1 is the message string, $2 is the type of message delivery (to the file) and $3 is the path

And how to specify the path of the current directory by the path and it is desirable to verify all the rules of php.ini and .htaccess so that, despite the rules of the host, the log file is in the same folder as the script file. I'm going to paste the code into each script of interest. And to see the problems at the registration address.

error_log("Error message\n", 3, "./"); - this will be enough or need something like:

 --force cows_superpower !important 

?

For me, PHP is an unexplored area, I’m missing console.log heroku logs --tail for nodejs. Please do not be surprised much question.

I get an error

 > Warning: error_log(./): failed to open stream: Is a directory in > /home/user***/public_html/index.php on line 20 
  • Understood my mistake. I'm going to look for logs. - Tomash Tarasovich
  • > the log file was in the same folder as the script file.> This is not cool. For PCP, the correct catching of errors is important, and it can catch everything including notices - it is desirable to store this in one file in the folder of the tmp / site, for example. And while development / debugging is underway, keep this file open in the auto-load editor, notepad ++ ex. - Goncharov Alexander
  • @GoncharovAlexander is not, no, no, I am not a php-Schnick and will not become them. I have a habit of writing console.log, and either the node reports errors to the server console or a browser to the client. Everything is interactive and fast. To see the script variables at the time of the execution error in the browser, I will have to learn how to write returned functions and learn how to render data from the returned functions in index.php. In your way, I will need to read other errors that arise here and look for my long log. And so launched and looked, changed, launched, looked. More convenient if not php-shnik. - Tomash Tarasovich
  • @GoncharovAleksandr please tell me how to write to the log in PHP. On bash, this is echo "rewrite"> error.log overwriting and this is echo "write" >> error.log writing to the end of the file Are there any different ways to write in php? - Tomash Tarasovich
  • one
    > and how to write to the PHP log <it appends and does not overwrite. > what are notices? <read, deployed about errors habrahabr.ru/post/161483 > console.log <well, there is a var_dump in php for example, or var_export is the same as console.log for you - Alexander Goncharov

0