Question

I'm getting following error when using imagick:

Fontconfig error: Cannot load default config file 

My script is working but i would like to fix this (is filling up log file).

OS is:

# cat /etc/redhat-release
CentOS release 5.10 (Final)

I was looking trough internet little bit and this is causing problem:

access("/etc/fonts/fonts.conf", R_OK)   = -1 ENOENT (No such file or directory)

Folder exists:

# ls /etc/fonts/ -all
total 64
drwxr-xr-x  4 root root  4096 Jul  9  2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x  2 root root  4096 Jan  3  2012 conf.avail/
drwxr-xr-x  2 root root  4096 Apr 14  2013 conf.d/
-rw-r--r--  1 root root  5239 Jan 12  2008 fonts.conf
-rw-r--r--  1 root root  6907 Jan 12  2008 fonts.dtd

But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.

Account under with script is run is created with WHM.

Please help :)

Was it helpful?

Solution

I manage to solve my problem. chroot was making trouble.

I need to:

  • log with root account
  • find jailed environment of account on with i run script (in my case /home/virtfs/[username])
  • to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
  • to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts

OTHER TIPS

Posting an answer for CentOS 7 in 2021:

yum install fontconfig

More info here:

https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top