Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy am I unable to use a variable in my require or include statement on XAMPP?
    primarykey
    data
    text
    <p>While cleaning up some old php scripts I've noticed some weird behavior with require/include statements when I try to use variables.</p> <p>On the live server, the following code works fine..</p> <pre><code>&lt;?php $test = "http://localhost/elearning/trunk/mypage.php"; require "$test"; ?&gt; </code></pre> <p>..but on my XAMPP installation ((basic package) version 1.6.7) I receive the following error:</p> <p>Warning: require() [function.require]: URL file-access is disabled in the server configuration in C:\Documents and Settings\username\Desktop\xampp-win32-1.6.7\xampp\htdocs\elearning\trunk\test.php on line 22</p> <p>Warning: require(<a href="http://localhost/elearning/trunk/mypage.php" rel="nofollow noreferrer">http://localhost/elearning/trunk/mypage.php</a>) [function.require]: failed to open stream: no suitable wrapper could be found in C:\Documents and Settings\username\Desktop\xampp-win32-1.6.7\xampp\htdocs\elearning\trunk\test.php on line 22</p> <p>Fatal error: require() [function.require]: Failed opening required '<a href="http://localhost/elearning/trunk/mypage.php" rel="nofollow noreferrer">http://localhost/elearning/trunk/mypage.php</a>' (include_path='.;C:\Documents and Settings\username\Desktop\xampp-win32-1.6.7\xampp\php\pear\') in C:\Documents and Settings\username\Desktop\xampp-win32-1.6.7\xampp\htdocs\elearning\trunk\test.php on line 22</p> <p>If I copy+paste <a href="http://localhost/elearning/trunk/mypage.php" rel="nofollow noreferrer">http://localhost/elearning/trunk/mypage.php</a> (directly from the error) into my browser, mypage.php loads. Is this an error in my configuration, or my approach?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload