久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術(shù)文章
文章詳情頁

讓你的PHP同時(shí)支持GIF、png、JPEG

瀏覽:7日期:2024-01-19 17:06:28
讓你的PHP同時(shí)支持GIF、png、JPEG 在RedHat6.2按php的manual編譯安裝,發(fā)現(xiàn)只能處理GIF圖像,不能處理JPEG圖像。后來知道PHP處理圖像,使用了GD庫,而GD庫開始時(shí)是支持GIF的,但由于GIF使用了有版權(quán)爭議的LZW算法,會(huì)引起法律問題,于是從GD-1.6開始,GD庫不再支持GIF,改為支持更好的,無版權(quán)爭議的PNG。而我現(xiàn)在希望同時(shí)支持GIF,PNG和JPEG。 1、 Jpeg6b的安裝 RedHat6.2中已經(jīng)有了RPM包,我們也就不需要去費(fèi)勁編譯了。 ;;放入安裝盤 ;;mount /mnt/cdrom ;;cd /mnt/cdrom/RedHat/RPMS ;;rpm -ivh libjpeg* 安裝成功,用rpm -ql libjpeg-6b-10 查看,發(fā)現(xiàn)libjpeg.so.62.0.0被拷到/usr/lib目錄下。記住此目錄,等會(huì)兒配php時(shí)要用。 2、 GD-1.8.3的安裝 獲取GD源碼的地址為: http://www.boutell.com/gd/ 你當(dāng)然可以自己編譯,但它不支持jpeg,要打補(bǔ)丁。 獲取補(bǔ)丁源碼的地址為: http://www.webofsin.com/gd-1.8.3-gif.patch 接下來………………麻煩死了……勸你還是不要自己編譯了!! 有現(xiàn)成的東西為何不用呢?已經(jīng)有人打好補(bǔ)丁編譯好了,做成RPM。 可以在: http://rpms.arvin.dk/rh7-backports/gd/ http://rpms.arvin.dk/gd-with_gif/ 得到。世上竟然有這么好的人?;-< 真令人感動(dòng)!!! 下載了幾個(gè)gd-with_gif*.rpm后直接 rpm -ivh gd-with_gif* 安裝。 用 rpm -ql gd-with_gif-1.8.3-7 查看 發(fā)現(xiàn) libgd.so.1.8.3 放到了 /usr/gd-with_gif/lib 下 記住此目錄,配php時(shí)也要用。 3、 PHP的安裝和配置 鑒于曾聽說php4.0不支持jpeg(不知記錯(cuò)沒),我建議還是用php的最新版。 下面的,大家應(yīng)該熟悉得不能再熟悉了吧? 于是我把php的manual抄下來: --------------------------------- 1. gunzip apache_1.3.x.tar.gz 2. tar xvf apache_1.3.x.tar 3. gunzip php-x.x.x.tar.gz 4. tar xvf php-x.x.x.tar 5. cd apache_1.3.x 6. ./configure --prefix=/www 7. cd ../php-x.x.x 8. 這里是關(guān)鍵!!! ;;./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars --with-jpeg-dir=/usr/lib --with-gd=/usr/gd-with_gif/lib ;;當(dāng)然你也可以加上你自己的選項(xiàng),此不贅述。 9. make 10. make install 11. cd ../apache_1.3.x 12. for PHP 4: ./configure --activate-module=src/modules/php4/libphp4.a 13. make 14. make install Instead of this step you may prefer to simply copy the httpd binary overtop of your existing binary. Make sure you shut down your server first though. 15. cd ../php-x.x.x 16. for PHP 4: cp php.ini-dist /usr/local/lib/php.ini You can edit your .ini file to set PHP options. If you prefer this file in another location, use --with-config-file-path=/path in step 8. 17. Edit your httpd.conf or srm.conf file and add: ;;;For PHP 4:;;AddType application/x-httpd-php .php You can choose any extension you wish here. .php is simply the one we suggest. You can even include .html . 18. Use your normal procedure for starting the Apache server. (You must ;;stop and restart the server, not just cause the server to reload by ;;use a HUP or USR1 signal.) --------------------------------------- ;;;;終于成功了,你可以啟動(dòng)apache用phpinfo()試一試,發(fā)現(xiàn)gd那里: ---------------------- ;;;;gd GD Support enabled GD Version 1.6.2 or higher GIF Support enabled PNG Support enabled JPG Support enabled WBMP Support enabled ---------------------- ^_^哈哈哈哈哈哈哈哈哈^_^ 你現(xiàn)在可以用到所有的php圖形函數(shù)了: ImageCreateFromGIF() — Create a new image from file or URL ImageCreateFromJPEG() — Create a new image from file or URL ImageCreateFromPNG() — Create a new image from file or URL …… 絕對(duì)沒問題!!!!
標(biāo)簽: PHP
主站蜘蛛池模板: 国产精品2019 | 国产一区二区三区在线免费观看 | 久久精品久久久 | 操皮视频 | 免费国产一区二区 | 日本 欧美 三级 高清 视频 | 日韩成人在线观看 | 免费av一区二区三区 | 国产亚洲精品美女久久久久久久久久 | 黄色片免费观看 | 黄视频免费在线 | 亚洲高清免费视频 | 精品国产一区二区三区日日嗨 | 日韩中文字幕一区二区 | 亚洲视频在线观看 | 日韩中字幕 | 狠狠夜夜| jizz在亚洲 | 久久中文视频 | 午夜精品久久久久久久白皮肤 | 另类中文字幕 | 欧美1级| 中文字幕一区在线观看视频 | 欧美精品亚洲 | 亚洲第一网站 | av免费网站在线观看 | 亚洲精品视频免费看 | 毛片毛片毛片毛片 | 亚洲视频在线免费观看 | 欧美日韩一区二区三区在线观看 | 亚洲视频久久久 | 国产精品国产精品国产专区不片 | 精品福利av导航 | 国产视频中文字幕 | 一区二区精品视频 | 成人免费淫片aa视频免费 | 国内精品99| h免费在线观看 | av免费在线观看网址 | 成人久久18| 狠狠操操操 |