Php img images cannot be displayed in Linux

Source: Internet
Author: User
Tags php server

I did not pay attention to this problem when I mounted the PHP server to Linux,

A few days ago but encountered in Linux verification code under the picture can not display the situation, found that Linux also has GD library support, so installed the php5-gd (I use PhP5)

This problem has been solved.

Today, I suddenly found that the IMG images could not be displayed. I searched the internet and obtained the following conclusions after testing:

He will search for a pc.jpg image by using the previous example. If you use an absolute path, this will go into a trap.

If the current path is/var/www/test (this path has your picture. php)

 

In picture. php, it is:

Definitely an error occurs. She will search for/home/wch in the/var/www/test path

The path for searching pc.jpg is

/Var/www/test/home/wch. This path does not exist at all.

It's a bit messy. You will understand the actual operation. As for the use of absolute paths, it is still to be studied.

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.