Production environment Nginx code Error 500

Source: Internet
Author: User

November 23, 2015 night after the completion of the BRS system (upload picture system), the test machine function found unable to upload the picture can not be uploaded to the server, after viewing the Nginx log found log nginx status code returned 500 (internal server error),

1, began to think that the Nginx permissions caused, the upload directory changed to 777, but still invalid, after thinking if it is a permission problem should not return 500, but 403 such as the status code, after the start of the next troubleshooting;

2, after the use of Google debugging function to troubleshoot, found seemingly database error, inserted data, some fields are not shown but can not be empty, so insert not into the number, because of database configuration problems, after the MySQL configuration file in the strict mode to the non-strict mode to solve the sub-problem;

Sql_mode=no_engine_substitution,strict_trans_tables,no_auto_create_user

Modified to:

Sql_mode=no_engine_substitution,no_auto_create_user

3, the database has been changed to upload the original image can be, but the generation of specification diagram cannot be uploaded, or error 500, ask the PHP engineer to find that there is a build specification diagram package in the compiled PHP exif.so not found, and then installed Exif.so the expansion pack after the test successfully solves the problem!

650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" Src= "/e/u261 /themes/default/images/spacer.gif "alt=" Spacer.gif "/>



First to understand what is the EXIF information of the picture

EXIF is an image file format whose data storage is identical to the JPEG format. In fact, the EXIF format is the insertion of digital photos in the head of the JPEG format, including aperture, shutter, white balance, ISO, focal length, date and time, and shooting conditions as well as camera brand, model, color coding, recorded sound during shooting and global Positioning System (GPS), thumbnails, etc. To put it simply, exif=jpeg+ the shooting parameters. As a result, you can browse the EXIF format with any viewing software that can view JPEG files, but not all graphics programs can handle EXIF information.


Open PHP Module

By default, PHP reads the image EXIF information module is not open, we need to first open this module.

To open the EXIF module requires mbstring support, so first to install mbstring, the following is the Linux environment for example, the other environment similar.

Installing the Mbstring module

First find the PHP source package location, directly into the ext/mbstring, execute the following command installation, the specific parameters to see their environment.


The code is as follows:


[Email protected] ext]# cd/data0/software/php/ext/mbstring
[Email protected] mbstring]#/usr/local/webserver/php/bin/phpize
Configuring for:
PHP Api version:20090626
Zend Module Api no:20090626
Zend Extension Api no:220090626
[Email protected] exif]#/configure--with-php-config=/usr/local/webserver/php/bin/php-config
[[email protected] mbstring]# make && make install
Installing Shared extensions:/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files:/usr/local/webserver/php/include/php/
[Email protected] mbstring]#

After the installation, we can go into the extensions directory to see if the module exists, the presence indicates that the installation was successful.

Production environment Nginx code error number

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.