file exist error

Discussion in 'Co-op Advertising Network' started by PinoyIto, Aug 12, 2005.

  1. #1
    Need help, my site getting the following error

    
    Warning: file_exists(): open_basedir restriction in effect. File(../ad_network_ads_346.txt) is not within the allowed path(s): (/home/httpd/vhosts/intellect-servers.com/httpdocs:/tmp) in /home/httpd/vhosts/intellect-servers.com/httpdocs/ad_network_346.php on line 36


    This is a newly setup site... site url http://www.intellect-servers.com

    Thanks
     
    PinoyIto, Aug 12, 2005 IP
  2. robokoder

    robokoder Peon

    Messages:
    146
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Looks like the file ad_network_ads_346.txt is in an invalid directory. Try putting it into the same directory as ad_network_346.php and editing it accordingly.

    So, any references to it in ad_network_346.php would be "./ad_network_ads_346.txt"

    Sorted?
     
    robokoder, Aug 12, 2005 IP
  3. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #3
    But they are the same location....
     
    PinoyIto, Aug 12, 2005 IP
  4. frankm

    frankm Active Member

    Messages:
    915
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    83
    #4
    you probably got another (backup?) file in a directory higher. remove that one.

    if that fails: change this block
    
    	$ad_file = 'ad_network_ads_123.txt';
    	for ($i = 0; $i <= 11; $i++) {
    		$p = substr ('../../../../../../../../../../', 0, $i * 3);
    		if (file_exists ($p . $ad_file)) {
    			$ad_file = $p . $ad_file;
    			break;
    		}
    	}
    
    PHP:
    with this

    
            $ad_file = '/apache/somesite/htdocs/ad_network_ads_123.txt';
    
    PHP:
    or what ever real path your file is at. Will save your server for looking thru a lot of dirs if you already knew where the file would be.
     
    frankm, Aug 12, 2005 IP