php5-gd 顯示在「php -i | grep -i gd」中,但不在 phpinfo() 中顯示;

php5-gd 顯示在「php -i | grep -i gd」中,但不在 phpinfo() 中顯示;

我正在嘗試在 Ubuntu 伺服器上安裝 Apache2、PHP5 和 MySQL 時啟用 GD。

我安裝了 php5-gd:
apt-get install php5-gd

當我跑步時php -i我得到:

gd

GD Support => enabled
GD Version => 2.0
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.4.8
T1Lib Support => enabled
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => unknown
PNG Support => enabled
libPNG Version => 1.2.46
WBMP Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 0 => 0

但它沒有出現在 phpinfo(); 中
我已經重新啟動伺服器四次,並且嘗試重新啟動 Apache2 四百萬次。

有誰知道如何解決這個問題?

答案1

您的伺服器上似乎libjpeg62沒有安裝。

安裝libjpeg62並重新啟動 Apache2。

sudo apt-get install libjpeg62

答案2

您確定 apache Web 伺服器中指向的 php 與您在程式中執行的 php 相同嗎?

據我所見, php -i 實際上正在運行 phpinfo(); 。

如果您有疑問:

   echo '<?php phpinfo(); ?>' | php 

答案3

在 Windows / Apache 中也有同樣的問題。透過使用extension_dir中的完整路徑修復

改變:extension_dir = "ext"

到:extension_dir = "c:/progra~1/php5513/ext"

顯然更改您的路徑以適合您的安裝資料夾

相關內容