Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have moved my website to another hosting server. However, there is a little problem with fopen() function. Every time it is run, it is resulting with the following error:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/www-virtual/www-username/www/bindata/gallery/GAL34e81b4adce22091c6ee31c71055e181.jpg) is not within the allowed path(s): (/www/default/www:/www/username_www:/tmp:/usr/local/lib/php:/usr/local/php-5.2/lib) in /www/username_www/www/frontend/gallery/GalleryPage.php5 on line 112

I can't do anything with the PHP script because it is ionCube encoded.

What is left to do then?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Change hosting companies now!

If they can't configure open_basedir correctly who know what other horrors lie in wait (yes, it might be valid for them to apply a blanket restriction - but if that were the case here why have they included someone else's dir in the whitelist).

share|improve this answer
add comment

One possible answer (from Stack Overflow) is to set an exception to PHP's open basedir in a .htaccess file

<Directory /var/www/vhosts/domain.tld/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/domain.tld/httpdocs:/var/www/vhosts/domain.tld/zend"
</Directory>

you can also completely remove the restriction with

<Directory /var/www/vhosts/domain.tld/httpdocs>
php_admin_value open_basedir none
</Directory>
share|improve this answer
    
If they've restricted the open basedir (albeit that they've got it WRONG) then they should have blocked htaccess overrides. –  symcbean Oct 28 '11 at 12:39
    
@symcbean I agree, but it's worth a shot. If it fails then probably the only option is to move hosting companies or try the hard the task of getting the current hosts to change their policy. –  Jon Rhoades Oct 28 '11 at 12:44
    
Is it possible that somewhere in those encoded PHP files, is the absolute path? –  Spyro Oct 28 '11 at 16:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.