Skip to content
TrySitePrice

RHEL / CentOS Xcache: /usr/include/php/ext/date/lib/timelib_structs.h:24:28: error: timelib_config.h: No such file or directory Error and Soultion

Best/Tutorial

The error message you are seeing is typically caused by a missing file called "timelib_config.h", which is required by the timelib library used by Xcache.

Here's how to fix the error:

  1. Install the required dependencies:

sudo yum install gcc make automake autoconf httpd-devel php-devel php-pear libmcrypt-devel libpng-devel libjpeg-devel freetype-devel libXpm-devel gmp-devel libxml2-devel openssl-devel libicu-devel libtidy-devel libxslt-devel

  1. Download and install the timelib library:

cd /usr/src/

sudo git clone https://github.com/php/php-src.git

cd php-src/ext/date/

sudo phpize

sudo ./configure

sudo make

sudo make install

  1. Copy the timelib_config.h file to the correct location:

sudo cp /usr/src/php-src/ext/date/lib/timelib_config.h /usr/include/

  1. Reinstall Xcache:

sudo pecl uninstall xcache

sudo pecl install xcache

  1. Finally, restart your web server:

sudo systemctl restart httpd

After completing these steps, the Xcache extension should be installed without errors.

Note that the specific steps may vary depending on your version of RHEL/CentOS, and the version of Xcache that you are installing. It's always a good idea to check the Xcache documentation for specific instructions.