1

I recently switched my site from Linux to Windows Server. In my old site there were WordPress Blog directory. For this I first uploaded entire blog directory to my new server & created database. Then re-configured database connection settings in wp-config file & uploaded it. All worked fine but when I clicked on any links in my blog first it takes too much time to get load(almost 2mins) & when loading finish it off then it shows me this error

PHP Warning: file_exists(): open_basedir restriction in effect. File(/home/brandst1k/public_html/blog/wp-content/uploads/2016/08) is not within the allowed path(s): (G:/PleskVhosts//brandstik.in\;C:\Windows\Temp) in G:\PleskVhosts\brandstik.in\httpdocs\blog\wp-includes\functions.php on line 1492 PHP Warning: is_dir(): open_basedir restriction in effect. File(/home/brandst1k/public_html/blog/wp-content/uploads/2016) is not within the allowed path(s): (G:/PleskVhosts//brandstik.in\;C:\Windows\Temp) in G:\PleskVhosts\brandstik.in\httpdocs\blog\wp-includes\functions.php on line 1497 PHP Warning: is_dir(): open_basedir restriction in effect. File(/home/brandst1k/public_html/blog/wp-content/uploads) is not within the allowed path(s):

Original error link - http://www.brandstik.in/blog/solar-rechargeable-camping-lantern/

I can understand that there is server misconfiguration which throws this error. Now only concern is how to solve this?

markratledge
  • 17,322
  • 12
  • 60
  • 106
SUN
  • 973
  • 14
  • 38
  • You need to search SO before posting: http://stackoverflow.com/search?q=open_basedir – markratledge Aug 08 '16 at 04:25
  • @markratledge Sorry but I am not friendly with php & wordpress since I am .net developer but this is one of my requirement to get it work. It would be helpful If you can give me some clarity with your solution. – SUN Aug 08 '16 at 04:44

1 Answers1

0

I had the same issue as yours, it was caused because of the misconfiguration file directory.

All you could do to solve this is add this code in your wp-config.php file.

      define('WP_TEMP_DIR','/tmp')

This did work for me.

Sheshnath
  • 301
  • 3
  • 10
  • The error does not originate with the tmp directory; it is an open_basedir error to begin with, and that makes the tmp directory unwritable. – markratledge Aug 08 '16 at 04:35
  • @markratledge Thanks for your feedback, I understand what you are trying to say but the above fix worked for me. – Sheshnath Aug 09 '16 at 14:56