filmov
tv
PHP Errors On (.user.ini file error reporting, display PHP errors)
Показать описание
PHP is a pain to debug because syntax errors can cause entire page to die and you might not find out until you test it on a server. Some IDE's & code editors can tell you syntax errors before running the code, but mysterious errors can appear out of nowhere. But it's pretty easy to turn on the feature to display errors.
Put this line in the file
display_errors = 1
(No need for semicolons, but it is case sensitive)
This is a hidden file with no name
If you can't see the file once created, then you probably need to "show hidden files"
-In windows, go to Control Panel
-Then "File Explorer Options"
-In the "View" tab, check "Show Hidden files, folders and drives"
THIS TAKES 5 MINUTES TO UPDATE ON THE SERVER
If you can't see it in your FTP program, you may need to enable hidden files there again
*Winscp Options❯Preference❯Panels, then "Show Hidden Files"
This file enables error reporting for files in the same directory as well as any subfolders
If you've waited more than 5 minutes & error reporting isn't working, add this line
phpinfo();
It displays basic information about your PHP server
Or you could include this line of PHP code in a PHP file and any future lines will have error reporting turned on
ini_set('error_reporting', E_ALL);
But this isn't the best if you want 2 identical copies of your site (live & development). That's why the 1st option is better
Put this line in the file
display_errors = 1
(No need for semicolons, but it is case sensitive)
This is a hidden file with no name
If you can't see the file once created, then you probably need to "show hidden files"
-In windows, go to Control Panel
-Then "File Explorer Options"
-In the "View" tab, check "Show Hidden files, folders and drives"
THIS TAKES 5 MINUTES TO UPDATE ON THE SERVER
If you can't see it in your FTP program, you may need to enable hidden files there again
*Winscp Options❯Preference❯Panels, then "Show Hidden Files"
This file enables error reporting for files in the same directory as well as any subfolders
If you've waited more than 5 minutes & error reporting isn't working, add this line
phpinfo();
It displays basic information about your PHP server
Or you could include this line of PHP code in a PHP file and any future lines will have error reporting turned on
ini_set('error_reporting', E_ALL);
But this isn't the best if you want 2 identical copies of your site (live & development). That's why the 1st option is better
Комментарии