Link command problem

Hello,

I have one issue with linking folders.

I have two domains (domain1 and domain2) on one server (centOS). In domain1, I have one folder containing many images which I want to share for domain2. So i have created link for image directory using below command.

ln -s /var/www/vhosts/domain1/httpdocs/public/images /var/www/vhosts/domain2/httpdocs/public/images

Above command has been created link folder in domain2 which linked to domain1 image folder. But now actual issue when I want to see images on domain2's web page, it is giving me an error. Below is the error which I'm receiving on website.

<b>Warning</b>:  file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/var/www/vhosts/domain2/httpdocs/public/images/1255698597_1307305_small.jpg) is not within the allowed path(s)

I guess that image is in domain1 so fopen is not performing due to Open_basedir Restriction.

Can anyone tell me how can I resolve this issue and how can i get domain1 images in domain2?
PS: I do not want to remove fopen command for file checking.

Would appreciate any kind of help.

Regards,

Create a common directory for images used by both domains, eg /var/www/common/images. Add that path to the open_basedir directive in your php.ini, create a symlink from the domains to this directory & reload the web server.