This code string cannot be displayed in linux. {code ...} access address demo for linux environment (problem) access address demo for mac environment (normal) If win is shut down, it will not be pasted (normal) I have added error_reporting (E_ALL); ini_s... this code string cannot display images in linux
$img_url = $_GET['img'];$content = file_get_contents($img_url);header('Content-Type: image/jpeg; charset=UTF-8');echo $content;
Demo of the access address in the linux environment (problem exists)
Access address demo in mac environment (normal)
If win is shut down, it will not be pasted (normal)
I added this code before.error_reporting(E_ALL);ini_set("display_errors","On");die;
No error found,
Checkallow-url-fopen
Ison
And canprint_r
The content is the same as follows:
����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 ��C ��C ��j�"�� ���}!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������� ���w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�����2���}x����bi��f(�IQ߆���]/�?
This string does not make much sense. It captures the header and adds it to it.
Add a phpinfo file for you to view.
Reply content:
This code string cannot display images in linux
$img_url = $_GET['img'];$content = file_get_contents($img_url);header('Content-Type: image/jpeg; charset=UTF-8');echo $content;
Demo of the access address in the linux environment (problem exists)
Access address demo in mac environment (normal)
If win is shut down, it will not be pasted (normal)
I added this code before.error_reporting(E_ALL);ini_set("display_errors","On");die;
No error found,
Checkallow-url-fopen
Ison
And canprint_r
The content is the same as follows:
����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 ��C ��C ��j�"�� ���}!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������� ���w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�����2���}x����bi��f(�IQ߆���]/�?
This string does not make much sense. It captures the header and adds it to it.
Add a phpinfo file for you to view.
This problem was solved at three o'clock last night and added before code output.ob_clean
In the debugging mode of Thinkphp, there will be unexpected output, but this output is not found yet, and this unexpected output will only be available in linux, it is suspected that there is a problem between the framework issue and the system configuration.
Normally, the image can be output. In windows, I have no problem during the test. Thinkphp may have some applications in ob cache. Clear them. Otherwise, the binary stream output directly in the browser may be faulty.
Less Scaling
Install freetype, javassrc, and libpng.
Header ('content-Type: image/jpeg; charset = UTF-8 ');
This line removes charset = UTF-8
Header ('content-Type: image/jpeg ');
After reading it, the corresponding header of lz isContent-Type: image/jpg
, It should beContent-Type: image/jpeg
.