Encountered two errors due to php.ini misconfiguration: Ajax image upload error and exec error
First of all:
In doing an Ajax image upload function, PHP reported such an error: File upload error-unable to create a temporary file;
Then Baidu, the discovery is due to the php.ini configuration file Upload_tmp_dir configuration is not handled well.
So Baidu under this: for reference
1. Because no temporary files are set in PHP.ini, the temporary file address of the system is the default.
2. This error occurs if you do not have permission to read the temporary file directory of the system.
The workaround is to remove the semicolon in front of the Upload_tmp_dir and set the temp file directory.
3. If it is a win system, set the temporary folder of all the parent folder to have "iusr_***** (Internet Guest account)" "List Folder Directory" permission, it is recommended to create this temporary folder in the PHP directory.
The second: Today in the compression front-end CSS file, found that compression is not, the program and permissions are correct, and then looked under, is due to the php.ini disable_function this configuration, resulting in the execution of the exec compression times wrong!
For security reasons, the server does not allow the EXEC command in PHP or other languages, and when you have a special need for PHP to execute the EXEC command on the server, you need to set two places, or you will not be able to perform the success
1, modify the php.ini
Find the PHP configuration file php.ini, if you are using an out-of-the-box PHP automatic installation program to configure the PHP environment, this file is in the C:\WINDOWS\ directory.
Search for "disable_functions" in the file, remove "exec", "shell_exec" after finding it, and save the file.
2. Modify the Cmd.exe file properties
Enter C:\WINDOWS\system32, locate cmd.exe this file, right-click Property, add the Internet Guest account in the "security" setting, that is, iusr_****** that account, then give "Read and run", "read" permission.
Once the setup is complete, PHP can execute the EXEC command on the server.
The above describes two due to Phpini configuration errors caused by error: Ajax image upload and exec error, including the content, I hope that the PHP tutorial interested in a friend helpful.