- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
$img = imagecreate(110, 20) or die("error!");
$bg = imagecolorallocate($img, 255, 255, 255);
$text_color = imagecolorallocate($img, 55, 55, 55);
imagestring($img, 5, 0, 3, "leo", $text_color);
imagepng($img);
imagedestroy($img);
当你执行这段代码时,Apache 会崩溃,我使用 gdb 调试 coredump 如下:
$gdb /usr/sbin/httpd /var/apachecoredumps/core.12029
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/httpd...Reading symbols from /usr/sbin/httpd...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[New LWP 12029]
[New LWP 12046]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/httpd -DFOREGROUND'.
Program terminated with signal 11, Segmentation fault.
0 0x00007f2cd96bafe9 in fill_window () from /lib64/libz.so.1
Missing separate debuginfos, use: debuginfo-install httpd-2.4.6-67.el7.centos.6.x86_64
(gdb) where
0 0x00007f2cd96bafe9 in fill_window () from /lib64/libz.so.1
1 0x00007f2cd96bb5f0 in deflate_slow () from /lib64/libz.so.1
2 0x00007f2cd96bc684 in deflate () from /lib64/libz.so.1
3 0x00007f2cb81c9dfa in png_write_find_filter () from /lib64/libpng15.so.15
4 0x00007f2cb81c4f95 in png_write_row () from /lib64/libpng15.so.15
5 0x00007f2cb81c51db in png_write_image () from /lib64/libpng15.so.15
6 0x00007f2cb8bab2ff in _gdImagePngCtxEx () from /lib64/libgd.so.3
7 0x00007f2cb8dfe149 in _php_image_output_ctx.isra.16 () from /usr/lib64/php/modules/gd.so
8 0x00007f2cbc0a45c5 in xdebug_execute_internal () from /usr/lib64/php/modules/xdebug.so
9 0x00007f2cd172e504 in zend_do_fcall_common_helper_SPEC () from /etc/httpd/modules/libphp5.so
10 0x00007f2cd16c2808 in execute_ex () from /etc/httpd/modules/libphp5.so
11 0x00007f2cbc0a3a58 in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
12 0x00007f2cd16870eb in zend_execute_scripts () from /etc/httpd/modules/libphp5.so
13 0x00007f2cd1621da2 in php_execute_script () from /etc/httpd/modules/libphp5.so
14 0x00007f2cd173012d in php_handler () from /etc/httpd/modules/libphp5.so
15 0x0000558429d3da40 in ap_run_handler ()
16 0x0000558429d3df89 in ap_invoke_handler ()
17 0x0000558429d52b0a in ap_process_async_request ()
18 0x0000558429d52de4 in ap_process_request ()
19 0x0000558429d4efe2 in ap_process_http_connection ()
20 0x0000558429d47040 in ap_run_process_connection ()
21 0x00007f2cd499880f in child_main () from /etc/httpd/modules/mod_mpm_prefork.so
22 0x00007f2cd4998a55 in make_child () from /etc/httpd/modules/mod_mpm_prefork.so
23 0x00007f2cd49996ee in prefork_run () from /etc/httpd/modules/mod_mpm_prefork.so
24 0x0000558429d2215e in ap_run_mpm ()
25 0x0000558429d1aed6 in main ()
有什么问题?
最佳答案
您需要配置您的 apache httpd.conf,并启用(也可能安装)它需要的包,例如:
Program terminated with signal 11, Segmentation fault. 0 0x00007f2cd96bafe9 in fill_window () from /lib64/libz.so.1
在这种情况下,您需要 libz。
我也建议更新到 php7。
之后使用这段代码:
<?php
header ("Content-type: image/png");
$img = @ImageCreate (110, 20)
or die ("error!");
$bg = ImageColorAllocate ($img, 255, 255, 255);
$text_color = ImageColorAllocate ($img, 55, 55, 55);
ImageString ($img, 5, 0, 3, "leo", $text_color);
ImagePNG ($img);
imageDestroy($img);
?>
关于php imagepng() gdb调试信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48107751/
我正在使用我编写的一个简单的缩略图脚本,它非常标准: $imgbuffer = imagecreatetruecolor($thumbwidth, $thumbheight); switch($typ
$img = imagecreate(110, 20) or die("error!"); $bg = imagecolorallocate($img, 255, 255, 255); $t
各位,首先,这是我的代码: >> DO NOT CHANGE 我们更改了服务器,现在,我明白了: 发生了什么事? 编辑 将 PHP 错误设置为 ON,我收到此警告: Warning: Cannot
我有这个 php 脚本,它应该在浏览器中返回一个 png 图像。 header('Content-Type: image/png'); $img=imagecreatefrompng($myimage
我有一个 .php 文件,该文件应该加载要在 img 标签中显示的图像 (即 )。它看起来像这样: 它工作正常,但图像加载比直接加载要慢得多 (即 ,其中“the_name”的计算方式与 PHP
我到处搜索以找到解决我的问题的可能方法。不幸的是,我似乎无法弄清楚。我有一个 .php 文件,它根据其他图像创建图像。我让脚本完全按照现在的样子运行,没有任何缺陷。但在摆弄其他一些文件后,它突然停止工
我正在使用我基于的脚本从用户上传的声音文件动态生成波形图像:http://andrewfreiday.com/2010/04/29/generating-mp3-waveforms-with-php/
我需要一些有关 PHP GD 的帮助。这是我的一段代码。 header("Content-type: image/gif"); $image = imagecreatetruecolo
我已经查阅了 PHP 手册来尝试反转图像的颜色,但我无法让图像以我需要的方式显示。 本质上,在 WordPress 循环中,我需要拍摄一张图像,将其反转,然后将 div 的背景图像设置为该反转图像。到
我已经查阅了 PHP 手册来尝试反转图像的颜色,但我无法让图像以我需要的方式显示。 本质上,在 WordPress 循环中,我需要拍摄一张图像,将其反转,然后将 div 的背景图像设置为该反转图像。到
我正在尝试创建一个脚本来获取图像的特定部分,但是当我使用 imagepng 时,它返回给我: 这是我的代码 $name = $path; header("Content-type: image/png
好吧,因为我不喜欢 PHP 中的 GD Libary 和 Image 函数,所以我有点卡住了……事实上,同样的函数在从上传的文件创建 JPEG 图像时没有问题——但它卡在了 png 上。 .. 我得到
好吧,因为我不喜欢 PHP 中的 GD Libary 和 Image 函数,所以我有点卡住了……事实上,同样的函数在从上传的文件创建 JPEG 图像时没有问题——但它卡在了 png 上。 .. 我得到
根据 PHP 的官方文档,imagepng() 函数具有以下签名: bool imagepng ( resource $image [, string $filename [, int $qualit
当我用 php 创建图像时,我遇到了一些 GD 问题。 奇怪的是,它可以在一台装有 5.3.1 版 php 的服务器上运行,但不能在 5.2.14 版 php 上运行。 (我不确定是 php 版本还是
据我们所知,我们可以通过将以下行添加到 .htaccess 文件来为图像指定缓存验证器: ExpiresActive On ExpiresDefault "access plus 1
我正在编写一个程序,为用户上传的照片加水印。完成分层后,imagePNG() 将照片输出到浏览器,但不会将其保存到目录。路径都是正确的,文件权限更改为 0755。仅使用函数的第一个参数 ( image
我使用以下代码创建图像并将其编码为 base64。没有直接输出图片。 ob_start(); // catching the output buffer imagepng($imgSignature)
我有一个 php 脚本,用于根据请求将图像发送到移动设备。在当前版本中,脚本运行并且在结束之前我使用 imagePNG() 将图像输出到设备但是在阅读 php 在线手册中的示例时我看到了这个示例:
当我尝试在 PHP 中调用 imagepng 时出现 SSL 错误。 消息:imagecreatefrompng():SSL 操作失败,代码为 1 我知道有一种方法可以在使用 get_put_cont
我是一名优秀的程序员,十分优秀!