Archive for August, 2009

Posted by 6bytes at 20, August, 2009

Category: CentOS, Linux

Problem

Sometimes after running yum update or yum install something you’re getting missing dependency error messages. Like this:

--> Missing Dependency: /usr/lib64/python2.4 is needed by package
gamin-python-0.1.7-8.el5.x86_64 (installed)
--> Missing Dependency: /usr/lib64/python2.4 is needed by package
libxml2-python-2.6.26-2.1.2.8.x86_64 (installed)

This means that some other package needs to be installed in order to install the one you want. If you have all dependencies installed and you’re still getting those messages all you need to do is clean yum’s cache.

Solution

Run one of these (taken from yum manual):

The following are the ways which you can invoke yum in clean mode. Note that “all files” in the commands below means “all files in currently enabled repositories”. If you want to also clean any (temporarily) disabled repositories you need to use –enablerepo=’*’ option.

yum clean packages

Eliminate any cached packages from the system. Note that packages are not automatically deleted after they are downloaded.

yum clean headers

Eliminate all of the header files which yum uses for dependency resolution.

yum clean metadata

Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will force yum to download all the metadata the next time it is run.

yum clean dbcache

Eliminate the sqlite cache used for faster access to metadata. Using this option will force yum to recreate the cache the next time it is run.

yum clean all

Runs yum clean packages and yum clean headers, yum clean metadata and yum clean dbcache as above.

Now run again your yum update or any other yum install command and it should be fine.

Posted by 6bytes at 14, August, 2009

Category: Linux, PHP

Problem

PHP has a bug with applying summertime in some timezones. If you’ve set correct timezone in your php.ini file and running

< ?php
echo date("r");
?>

still gives you wrong time its quite possible that you’ve just found this bug.

Solution

To correct this you need to install new timezone file. Run below command on your server:

$ pecl install timezonedb

Successful installation should result in something like this

Build process completed successfully
Installing '/usr/local/lib/php/extensions/debug-non-zts-20060613/timezonedb.so'
install ok: channel://pecl.php.net/timezonedb-2009.10
configuration option "php_ini" is not set to php.ini location
You should add "extension=timezonedb.so" to php.ini

open your php.ini file

$ vim /etc/php.ini

add line “extension=timezonedb.so” as instructed.

If PHP now surprises you with

PHP Warning:  PHP Startup: Unable to load dynamic library './timezonedb.so' - 
./timezonedb.so: cannot open shared object file: No such file or directory in 
Unknown on line 0

you need to add full path to the “timezonedb.so” file in your php.ini
Install process returns the full path to “timezonedb.so” but if you need to find it type:

$ find / -name timezonedb.so

edit your php.ini once more and change

extension=timezonedb.so

to

extension=/path/to/your/php/extensions/timezonedb.so

Done.