vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help on PHP includes (https://vborg.vbsupport.ru/showthread.php?t=33456)

slideboxer 12-24-2001 05:48 AM

I'm trying to add some PHP includes to my sites home non-vB page. I'm not too familiar witht his stuff but I follow directions well :D Anyway, I'm using <? include("vbforums/filename.php"); ?> to read the info but I keep getting the following error:

Fatal error: Failed opening required './admin/config.php' (include_path='.:/usr/local/lib/php') in /home/www/mysite/vbforums/global.php on line 96

I've received this error on several different hacks I've attempted. What can i do to remedy this?

JamesUS 12-24-2001 08:11 AM

Try this (no idea if it will work but worth a try):

PHP Code:

chroot("/home/www/mysite/vbforums/");
require(
"./global.php");
chroot("/home/www/mysite/"); 


slideboxer 12-26-2001 03:55 AM

I found I needed to use the chdir command. Oddly I'm having to use it with each and evry include on the page, not sure if that's the way ti's supposed to be ot not, but, it's all working. Thanks for the reply.

Mark Hensler 12-26-2001 08:38 PM

Easiest way is to just alter your include_path. There are two way you can do this...

Via .htaccess:
Code:

php_value include_path .:/home/www/mysite/vbforums:/home/www/mysite/php-includes
Via PHP:
PHP Code:

ini_set("include_path"ini_get("include_path") . ":/home/www/mysite/vbforums:/home/www/mysite/php-includes"); 

I prefer using .htaccess because I can put it in my root web directory and the changes are global. It's a lot easier to edit one file than many.

PHP Docs: ini_set(), ini_get()


All times are GMT. The time now is 10:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01083 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete