Home > Article > Backend Development > What to do if images cannot be displayed in iis php
The solution to the problem that iis php pictures cannot be displayed: 1. Set a temporary directory for the "upload_tmp_dir" item in "php.ini" and set the corresponding permissions; 2. Change "C:\Windows\Temp "Add the corresponding permissions to the directory.
Recommended: "PHP Video Tutorial"
PHP images uploaded in Windows IIS 401 cannot be accessed The solution
When the project went online today, I found that the uploaded pictures could not be displayed normally. A 401 permission issue was reported. Here is the solution.
Summary of the problem:
Under the Windows platform, if PHP uses IIS, when uploading files, PHP will first upload the files to a temporary directory.
(This configuration item can be found in php.ini Configure in " upload_tmp_dir ". Since our server has not been configured, php will use the system's temporary directory "C:\Windows\Temp" ).
Solution:
1. Set a temporary directory for the upload_tmp_dir item in php.ini and set the corresponding permissions (recommended method)
2. Add corresponding permissions to the "C:\Windows\Temp" directory
Important note:
The upload_tmp_dir directory permissions of php.ini must include IUSER and IIS_IUSERS permissions or Everyone
The above is the detailed content of What to do if images cannot be displayed in iis php. For more information, please follow other related articles on the PHP Chinese website!