Two errors due to php.ini misconfiguration: Ajax image upload error and exec error, _php tutorial

Source: Internet
Author: User

Two errors due to php.ini misconfiguration: Ajax image upload error and exec error,


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.

http://www.bkjia.com/PHPjc/1135475.html www.bkjia.com true http://www.bkjia.com/PHPjc/1135475.html techarticle two error due to php.ini misconfiguration: Ajax image upload errors and exec error, encountered two due to php.ini configuration errors caused by error: Ajax images upload an error and exec error First ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.