1
votes

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?

1
You need to search SO before posting: stackoverflow.com/search?q=open_basedirmarkratledge
@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

1 Answers

0
votes

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.