# Link command problem

**URL:** <https://community.unix.com/t/link-command-problem/258452>\
**Category:** Linux\
**Created:** [January 28, 2010, 8:10am UTC](https://community.unix.com/t/link-command-problem/258452 "2010-01-28T08:10:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitshah.in](https://community.unix.com/letter_avatar/amitshah.in/32/6_22734026db12803ebb3e059622ac3534.png) [@amitshah.in](https://community.unix.com/u/amitshah.in)\
**Post date:** [January 28, 2010, 8:10am UTC](https://community.unix.com/t/link-command-problem/258452/1 "2010-01-28T08:10:49Z")

</div>

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.

```nohighlight
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.

```nohighlight
<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,

---

<div class="post-metadata">

**Author:** ![pludi](https://community.unix.com/user_avatar/community.unix.com/pludi/32/1278_2.png) [@pludi](https://community.unix.com/u/pludi)\
**Post date:** [January 28, 2010, 8:24am UTC](https://community.unix.com/t/link-command-problem/258452/2 "2010-01-28T08:24:29Z")

</div>

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.
