Home > PHP Framework > Laravel > What to do if laravel image upload fails

What to do if laravel image upload fails

藏色散人
Release: 2021-12-31 16:02:44
Original
2481 people have browsed it

Solutions to laravel image upload failure: 1. Enable file upload in the PHP configuration file; 2. Install the extension "fileinfo"; 3. Close open_basedir; 4. Rewrite the path.

What to do if laravel image upload fails

The operating environment of this article: linux5.9.8 system, Laravel version 5.7, MacBook Air 2019 computer.

laravel What should I do if the image upload fails?

linux server laravel project failed to upload images

##Summary The following reasons occur:

1.Linux file permissions problem, (make sure the upload directory file permissions are '777')

2.PHP configuration file enables file upload


What to do if laravel image upload fails ----------Pagoda----------------------------------------- ------------------

3. Expand "fileinfo"


What to do if laravel image upload fails Under normal circumstances, you can upload it here. If you still Tip
Upload failedThen check the error log Log location:

What to do if laravel image upload fails

PHP Warning: Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/www/wwwroot/) in Unknown on line 0PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0’,
Copy after login

------------- -----What error is this reported?

PHP warning: Unknown:
open_basedirThe restriction is valid. File (/tmp) is not within an allowed path: (/www/wwwroot/) in unknown at line 0 PHP message: PHP warning: File upload error - Cannot create temporary file in "unknown" at line 0,

Solution:

Either turn off open_basedir, or rewrite the path; (php.ini)

Summary

The error log is a good thing, real.

Related recommendations:

The latest five Laravel video tutorials

The above is the detailed content of What to do if laravel image upload fails. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template