Two errors caused by incorrect php. ini configuration: ajax image upload error and exec error ,. Because php. ini configuration error: ajax image upload error and exec error. ini configuration error: ajax image upload error and exec error. ini configuration error: ajax image upload error and exec error,
Two errors were reported due to incorrect php. ini configuration: ajax image upload error and exec error.
First, first:
In the ajax image upload function, php reports the following error: File upload error-unable to create a temporary file;
Then Baidu found that the configuration of upload_tmp_dir in the php. ini configuration file was not properly processed.
So Baidu has this: for reference
1. because no temporary file for upload is set in php. ini, the default address is the temporary file address of the system.
2. if you do not have the permission to read the temporary file directory of the system, the above error will occur.
The solution is to remove the semicolon before upload_tmp_dir and set the temporary file directory.
3. for Windows systems, all parent folders in the temporary folder must have the "list folder directories" permission for "IUSR _ ***** (Internet guest account, we recommend that you create this temporary folder in the PHP directory.
Second: When compressing the front-end css file today, I found that the file cannot be compressed, and the program and permissions are correct. then I checked it out because php. the configuration of the disable_function of ini causes an error when exec compression is executed!
For security reasons, the server does not allow php or other languages to execute the exec command. when you have special requirements for php to execute the exec command on the server, you need to set two places, otherwise, the execution will fail.
1. modify php. ini
Find the php configuration file php. ini. if you use the out-of-the-stars php automatic installation program to configure the php environment, this file is in the C: \ WINDOWS \ directory.
Search for "disable_functions" in the file, find it, remove "exec" and "shell_exec", and save the file.
2. modify attributes of the cmd.exe file
Go to C: \ WINDOWS \ system32, find the cmd.exe file, right-click-> properties, and add the Internet guest account in "security" settings, that is, the IUSR _ ****** account, then Grant "Read and run" and "read" permissions.
In this way, php can execute the exec command on the server.
Errors: ajax image upload error and exec error first...