Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9042953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:37:43+00:00 2026-06-16T10:37:43+00:00

I am getting the error Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/) is

  • 0

I am getting the error

Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (VIRTUAL_DOCUMENT_ROOT:/tmp/) in /www/elitno.net/s/p/anger2/home/site/classWebPage.php on line 83

My phpinfo file is here -> http://spaceranger2.elitno.net/phpinfo.php

The line where the error is occuring is here:

function openLink(){
    $this->fp = fopen($this->URL, "rb");
    array_shift($http_response_header);
    $this->headers = $http_response_header;
}

I only have access to .htaccess but not my php.ini file; i tried using this

open_basedir = "VIRTUAL_DOCUMENT_ROOT:/tmp/:/www/elitno.net/s/p/ranger2/home/site/"

but this generates 500 internal error‘s, any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T10:37:44+00:00Added an answer on June 16, 2026 at 10:37 am

    Generally fopen is only allowed to open files to which the user running the script has access.

    You have designed your function openLink() to actually open a particular URL. You should note that when using fopen it actually indicates opening a file on the disk. If you pass values like / or /filename.txt it is actually going to try and open the file on the disk at that absolute filesystem path.

    From your question data you are telling fopen to open /. That’s the root of the filesystem of the server. Your user definitely won’t have access to it (and hence the error you see).

    If you want to open a relative path to your website consider prefixing the site URL to the $this->URL variable before passing it to fopen to indicate that you are trying to open a URL.

    You can do something on the following lines:

    function openLink(){
        $siteURL = "http://www.example.com";
        $urlToOpen = $siteURL . $this->URL;
        $this->fp = fopen($urlToOpen, "rb");
        array_shift($http_response_header);
        $this->headers = $http_response_header;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been getting an error in a PHP script: simplexml_load_file() [function.simplexml-load-file]: I/O warning :
I'm getting an error WARNING: Method pl for function pl not found , I
I'm getting an error: WARNING: Illegal character in path at index 25: file:/C:/Users/bkuhl/Java_Projects/CMT/build/web/WEB-INF/lib/antlr-2.7.6.jar I'm
I am getting the following error: Warning: fopen() [function.fopen]: Unable to access Archive-Report-Sat-Dec-2011 12-12-42.xls/var/www/vhosts/eample.com/httpdocs/_files/Archive-Report-Sat-Dec-2011
I am getting the error: Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server
Getting the following error when trying to start a session: Warning: session_start() [function.session-start]: Node
I am getting the error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL
I'm getting this error: Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home1/host/public_html/employee/message/config.php on line
I keep getting this error: Warning: preg_match() [function.preg-match]: Unknown modifier 't' in D:\xampp\htdocs\administrator\components\com_smms\functions\plugin.php on
I'm trying to open a file using fopen, and I am getting the error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.