I'm not able to compile freetype support in php…
My configure command is:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-bcmath
--enable-zip --with-zlib --with-gd --with-jpeg-dir=/usr/lib --with-mysqli
--enable-mbstring --with-pdo-mysql --with-pgsql=/usr/lib/pgsql
--with-freetype-dir=/usr/lib --enable-gd-native-ttf
and it runs fine (doesn't complain about anything), compilation is succesful too, but in the end freetype support is not enabled:
["GD Version"]=> string(27) "bundled (2.0.34 compatible)"
["FreeType Support"]=> bool(false)
["T1Lib Support"]=> bool(false)
/usr/lib looks like the right place to look for freetype:
# pwd
/usr/lib
# ll|grep -i freetype
lrwxrwxrwx 1 root root 21 Dec 10 13:35 libfreetype.so -> libfreetype.so.6.3.10
lrwxrwxrwx 1 root root 21 Dec 10 13:35 libfreetype.so.6 -> libfreetype.so.6.3.10
-rwxr-xr-x 1 root root 525448 Nov 16 17:55 libfreetype.so.6.3.10
OS is Centos Linux 5, php version is 5.2.17.
Any hints? Thanks!
Best Answer
Since this question is about compiling PHP with FreeType support and not installing it, I wanted to add to this just in case someone else (like me) is having this problem and needs to compile a version of PHP that isn't available as a package.
--with-freetype-dir
isn't correct. You want the include directory and not the lib directory of freetype. In my case (on CentOS v6.7), the directory was/usr/include/freetype2
. You can find this by runningfind / -name freetype2
../configure
with the--with-freetype-dir
argument that was determined above. In the case of this question, the full command would be./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-bcmath --enable-zip --with-zlib --with-gd --with-jpeg-dir=/usr/lib --with-mysqli --enable-mbstring --with-pdo-mysql --with-pgsql=/usr/lib/pgsql --with-freetype-dir=/usr/include/freetype2 --enable-gd-native-ttf
make clean
first. The configuration has changed so all of the objects to wiped be recompiled.make
and thenmake install
to compile PHP.php -i
or viewing the output ofphpinfo();
. If using a web server, you may need to restart it for the changes to come into effect.