Categories
PHP Software Tricks WordPress

Timthumb not showing images and throws “Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. ” error. [Solved]

timthumbRecently I faced a situation where the timthumb script was unable to crop the images and was throwing error messages. There are themes those still use timthumb even though its a bad practice to use in themes when we have already functions available in core WordPress. Anyway I had to fix the issue as I was not state to replace the timthumb functionality with core WordPress functions.

Here is the error message:

This issue occurs in several hosts, mainly the free hosts available these days. So, the trick is to find where the $docRoot variable was set and set it to my public_html folder manually in my home directory. In my file it was on line number 825. I did the following…

Obviously the /a9582221/ would be your username.

Where to make this changes ??
Search for the file timthumb.php and make the above changes. Thats it. The issue got resolved now.

By Subharanjan

Zend Certified Engineer (PHP), WordPress Developer, Software Engineer at Axelerant, India. I love PHP, MySql, Wordpress, BuddyPress, JavaScript, HTML5, CSS. Currently playing around with WordPress Development, Plugin Development, Theme Customization, Drupal. Subharanjan Mantri

2 replies on “Timthumb not showing images and throws “Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. ” error. [Solved]”

Leave a Reply