php-GD enabled in FreeBSD

hohohoho…………………….. i finally found how to solve error in GD + php.Useally, when we try to install php + gd enabled, we will get some error, not error when we complie php or gd, but error in your web. like your image won’t display properly in your web.. why i wrote this article, because i’ve got experience. when i migrate my system from linux to freebsd, because the HD error T_T, i install php with gd. i think, it will same from the old system. but, when i finished installing php+ gd, iv got the problem. jpeg or jpg image wont display properly. my expericence is, when i try to upload a jpeg or jpg image, i ve got some error, altough the web is normal, work properly. jpeg or jpg image thumbnail view  wont displayed. damn!!!!!!! i’ve install gd from the freebsd ports and compile php from source manually. hooooooooooo, then my partner check the php info. shit!!!! jpeg not enabled in php……waaaaaaaaaaaaaaaa.. what happen????    my friend told me, gd in freebsd still got some error. beuuuuuu….. ive try many times with different options in php, but still got same problem, jpeg/jpg image wont display properly. T_T…………. i finally realize i must install libpng + libjpeg manually, not from the bsd ports….. ckckcckkcckckk, just waste my time (almost 2 monhts, ive got this problem T_T). hmmmm. i must solve it!!!!! then, i remember, my students mirror still up ^_^. i try to install libjpeg and libpng manualy and gd from ports. first still error, those packets got error when i compile it. and the second. hoohohoho it works (my friend said that)….. almost 8 hours with my daemon ^_^ just to enabling GD in php in freebsd. but how i solve it??????

hmmmm……………… frist you should fetch it manually thoose packets (i install thoose packets in freebsd fresh install ^_^), here there are :


after you fetched it follow this steps :
1. you should install mysql first, if you plan your web using databases
cd /usr/ports/databases/mysql-server/
make WITH_LINUXTHREADS=yes install clean
(and so on….. i wont explain in         here)
2.install httpd. im using httpd-2.x.x…….. just up to you (using httpd-2.x.x                 versions). i think you know how to install httpd apache server from source. i’ve         explained it before
3. install your libxml2 first
tar xzvf libxml2-2.6.22.tar.gz
cd libxml2-2.6.22
make install

4. install your zlib.
    tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
make install
make clean

5. libpng
tar xzvf libpng-1.2.9.tar.gz
cd libpng-1.2.9
cp scripts/makefile.std makefile

edit your makefile, find “prefix= ………..” (i dont remember it), change it to
mkdir /usr/local/libpng2
make install
make clean

6. install your jpeg library.
tar -zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure –prefix=/usr/local/jpeg6 –enable-shared
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/include
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/man
mkdir /usr/local/jpeg6/man/man1
make install-lib
make install
make clean   

7.    install GD
cd /usr/ports/graphics/gd
make install clean

huhhhhh……… finished installing library GD support.. then, finally install your php.
just follow this steps..
tar xzvf php-5.x.x.tar.gz
cd php-5.x.x
./configure –prefix=/usr/local/httpd/php –with-gd –with-apxs2=/usr/local/httpd/bin/apxs –with-xml –with-mysql –with-zlib –with-jpeg-dir=/usr/local/jpeg6 –with-png-dir=/usr/local/libpng2 –disable-debug –enable-trans-sid –enable-sockets –enable-memory-limit
(one line of course, i assume that you install your httpd apache server in /usr/local/httpd, and php in /usr/local/httpd/php)
make install
then copy your php.ini in /usr/local/httpd/php/lib/

next step just adding “AddType application/x-httpd-php .php” in your httpd.conf….

just wait and see the difference……….. i check my web, hmmmm looks fine. then i asked my partner (web programer), “did the GD still error????” my partner told me “hoho, thats worksss”………….huaaahhhhhahahaha finally finish it !!!!!!!

hmmmmm……… just share my experience with the daemon ^_^ thanks to allDelta for the team works ^_^. solved one problem, another problem still wait. like Indonesian peole said, “derita tiada akhir” hahahahahhaahha.. just kidding. hope it will help you too…………




Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s