skip to Main Content

I’ve recently installed php and mysql in a new windows server IIS and transferred my script there, there’s a problem that after enabling error log in php manager, I just get one line error repeatedly for everything as this:
PHP Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0

at the old server, error log was working great and php version is 7.4.33 in both of them.

all error loggers in php.ini is set to true but the problem still is remained in place.
if I set track_errors=Off then no error will be logged in php_errors.log

Any idea of why this is happening and how to fix it?

2

Answers


  1. Chosen as BEST ANSWER

    Finally, I've solved the problem by changing the permission of Temp Folder.

    Before changing the Temp directory permission, I've tried using a different php.ini, the php.ini-development one, and then error log started logging, comparing my original php.ini and the new one, I've found these 3 lines maybe causing the problem as I removed them and system started logging again

    upload_tmp_dir = "C:WindowsTemp"
    cgi.force_redirect = 0
    cgi.fix_pathinfo = 1
    fastcgi.impersonate = 1
    

    But as there were more different configs in file, I've started checking permissions!

    Temp folder had a full access permission for IIS_USER, but for Users, it was just a limited permission. after I've changed the permission for Users to Full Access, the problem solved and errors started to show up in error log file again.


  2. Firstly, it’s not an error, it’s a notice. Notice of depreciation as the beginning suggests. You can check what each log level means in PHP here.

    8192 E_DEPRECATED (int) Run-time notices. Enable this to receive
    warnings about code that will not work in future versions.

    Secondly, you fixed it by setting track_errors to Off. That functionality is deprecated, which means that it will be removed in future versions and you should be discouraged from using it.

    track_errors "0" PHP_INI_ALL Deprecated as of PHP 7.2.0, removed as of
    PHP 8.0.0.

    If you want to keep that enabled and get rid of the depreciation notices, you can change error_reporting value listed on page above to not include them by adding ~E_DEPRECATED to it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search