Centos中安裝PHP模組/exif擴充(不需要重裝PHP)

來源:互聯網
上載者:User

安裝exif不需要另外安裝庫,所以省略掉了安裝庫的步驟。

比如php的安裝目錄為:/root/lnmp0.4-full/php-5.2.10/

則執行:cd /root/lnmp0.4-full/php-5.2.10/ext/

我們要安裝exif模組,執行cd exif/

再執行 /usr/local/php/bin/phpize 會返回如下資訊:

Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525

再執行以下命令:

[root@vpser imap]# ./configure –with-php-config=/usr/local/php/bin/php-config

[root@vpser imap]# make && make install

執行完返回:

Build complete.
Don’t forget to run ‘make test’.

Installing shared extensions:�0�2�0�2�0�2�0�2 /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

表示已經成功,再修改/usr/local/php/etc/php.ini

尋找:extension = 再最後一個extension= 後面添加上extension = “exif.so”

儲存,執行/etc/init.d/php-fpm restart 重啟。

在/home/wwwroot/下面建立一個exif.php的檔案,內容如下:

< ?php

$exif = read_exif_data ('IMG_0001.JPG');
while(list($k,$v)=each($exif)) {
echo "$k: $v
n”;
}

?>

其中IMG_0001.JPG為照片檔案。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.