Questions tagged [set-include-path]
31 questions
10
votes
2 answers
define my own BASE_PATH vs. set_include_path?
I learned of the function set_include_path(). All this time, I defined a constant in the config.php file
define('BASE_PATH', '/var/www/mywebsite/public_html/');
And in all subsequent php files, I would include like…

John
- 32,403
- 80
- 251
- 422
8
votes
1 answer
Why use set_include_path() in PHP and how to autoload classes from different folders?
I have a couple questions about the include path in PHP and including files and/or classes.
Below is a simple snippet of code where we are setting multiple include paths. I saw this in another project but I am not sure why?
I have never had to…

JasonDavis
- 48,204
- 100
- 318
- 537
7
votes
4 answers
Set numerous include paths?
I know how to set an include path:
set_include_path('/path');
But how can I set multiple include paths?
For example: in two different directories.

Richard Knop
- 81,041
- 149
- 392
- 552
3
votes
2 answers
CLI include paths to run zend framework via cron
I wrote a command line utility using Zend Framework to do some nightly reporting. It uses a ton of the same functionality the accompanying site. It works great when I run it by hand, but when I run it on cron I have include path issues. Seems like…

summerg
- 57
- 6
2
votes
3 answers
PHP set_include_path statement
I can't quite figure out the meaning of this statement:
set_include_path('.'
. PATH_SEPARATOR . '../library/'
. PATH_SEPARATOR . '../application'
. PATH_SEPARATOR . get_include_path());
A quick breakdown would be appreciated.

Eric
- 429
- 2
- 6
- 15
2
votes
1 answer
What is the proper way to include the zend framework?
I have downloaded the Zend Framework and put it just above the server root (Where /tmp is and such) and I'm having trouble getting it recognized by a single PHP file. I am using a shared host and this is how I am including the…

nkcmr
- 10,690
- 25
- 63
- 84
2
votes
0 answers
site/perl directory is missing in perl @INC search path
I am developing a bunch of Perl scripts for my workmates and me.
To ease distribution, Perl itself resides on a network path and is used from there directly using this header:
@rem = '--*-Perl-*--
@echo off
\\network\path\to\Perl\bin\perl.exe -x -S…

frankme
- 21
- 1
2
votes
3 answers
PHP Composer autoloader does not load files in include path
Assume there are two projects "project_a" and "project_b". I am setting the include path dynamically in index.php of project_a via set_include_path to be able to use the files of project_b lying in folder…
user3348771
2
votes
2 answers
set_include_path Fatal error: Class 'MyClass' not found in file
I'm trying to include a custom path to a certain file using php's set_include_path. Here's the code:
file.php

Tafadzwa Gonera
- 352
- 6
- 20
1
vote
1 answer
set_include_path() Can someone set me straight
I've been through the site regarding this subject but I'm still confused. I have fixed my problem but I know deep down I have kind of cheated and it's a fix that could cause me problems further down the line. Let me explain where I am:
Here is a…

Andrew Myers
- 451
- 3
- 13
1
vote
1 answer
php set_include_path drives me crazy
I need to include a file in php so I do
$web_proc = '../res/proc'; //variable read from config file I can't change
//in my file
include_once($web_proc . '/check_sprache.php');
and PHP outputs:
Warning: include_once(../res/proc/check_sprache.php):…

beatjunky99
- 149
- 11
1
vote
4 answers
Including files in PHP scripts from any directory with absolute path
Possible Duplicate:
PHP require file from top directory
I've been using PHP for a long time but I've always just written it to get the job done, now I'm trying to learn best practices and improve my skill. Right now I'm wondering what is the best…

thestepafter
- 598
- 1
- 4
- 20
0
votes
1 answer
set_include_path function does not work, PHP 5.2.13
We are using a VPS server in our company and I'm trying to install Roundcube webmail interface
But I can't even get to the configuration phase because the set_include_path function doesn't work and the script can't find the required configuration…

Onur Kucukkece
- 1,708
- 1
- 20
- 46
0
votes
1 answer
Omit directory name when including header files in different folder than src
Suppose a folder structure in a C++ project with an include directory with header files,a src directory with .cpp files and the makefile. Lets assume header.h lives in /include,I want to be able to #include the header above without the ./include/…

laegirl
- 144
- 13
0
votes
1 answer
include_path working fine with php, but not working in .htaccess... what gives?
I just moved some programs from 1 server to another. They were working on the old server... (I know that's loaded, but from what I see it shouldn't make a difference). I've looked at the "similar titles" questions, but cannot find anything like what…

jasonflaherty
- 1,924
- 7
- 40
- 82