![]() |
Including a php file
Hello, I include a php file via plugin using this code:
Code:
ob_start(); Code:
$includedphp Quote:
|
This is not an error with the plugin, but an error with the file you are including. Does it work stand-alone?
|
It should.. what can I try to do?
|
Fix the errors in the file... It tells you what and where they are. It looks like you've used an absolute URL as an include. A lot of server configurations prevent this. You should use absolute filesystem references (ie. /home/user/file.php).
|
This is the content of my test/includes/dbar.php file:
Code:
<!-- Start Dbar --> Code:
Warning: Unknown(): open_basedir restriction in effect. File(/var/www/virtual/mysite.com/htdocs/test/includes/dbar.php) is not within the allowed path(s): (/var/www/virtual/community.mysite.com/:/var/www/virtual/community.mysite.com/htdocs/:/usr/share/php/:/tmp/) in [path]/global.php(384) : eval()'d code on line 3 |
Do you have the file inside your web folder, open_basedir suggests you don't have it in a folder your own/associated with your site.
|
That's on the same server my site is.
|
not just server, but folder
for example including the following on username1's site will work. /home/username1/public_html/phpinclude.php Including the following on username1's site won't work, as username1 doesn't own/have permission to the file. /home/username2/public_html/phpinclude.php Probably not the best explanation, but its the best i've got :D |
Yup, I understand. But I'm sure that's the same site folder.
For security I have also retrieved the directory path using this: PHP Code:
|
Probably better using cURL since you only want the content of the page, and it'll allow you to use URLs to specify the location of the file assuming your PHP setup allows for it.
Code:
$curl_handle = curl_init(); |
That give me this php error:
Code:
Fatal error: Call to undefined function: curl_init() in /var/www/virtual/site.com/htdocs/forum/global.php(384) : eval()'d code on line 7 |
That error is from not having curl configured on the server
If this is with a hosting company, you will need to have them install/enable it. If this is a Windows based system, CURL can be enabled by uncommenting the curl extension line in the php.ini file - extension=php_curl.dll and restarting the web server. If this is Unix/Linux, PHP must be compiled with CURL support and the libcurl library must be installed. |
In the other way.. using this code:
Code:
ob_start(); |
And the error is?
|
<a href="https://vborg.vbsupport.ru/showpost.php?p=1686626&postcount=5" target="_blank">https://vborg.vbsupport.ru/showp...26&postcount=5</a>
|
According to your server's configuration, from the current location of vBulletin, you are only allowed to include files from:
Code:
/var/www/virtual/community.mysite.com/ |
All times are GMT. The time now is 12:33 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|