include-path

How to append a path to PHP's include_path in .htaccess

Currently on my site I'm using statements like: include 'head.php'; include '../head.php'; include '../../head.php'; depending on how many nested folders deep I am. I'm sure there is a better way to do this. I'm convinced .htaccess is the solution, but I'm not sure how to go about implementing it. If I insert: php_value include_path...

How can I get MIDL to search additional include directories for qualified paths

Update: Just over six months after opening a support call to Microsoft it has been rejected, they claim it is not a bug (since the documentation doesn't explicitly say that the behaviour seen isn't the correct one). They rejected the DCR saying that since they haven't heard any complaints in the last 10 years this is obviously not an com...

PHP include paths - include fails if file referred to with "./" prefix

I'm having issues with includes when the included file itself includes another file but refers to it with the dot prefix. For example there are three files - inc1.php, inc2.php, and subdir/test.php, the contents of which are - subdir/test.php: set_include_path(get_include_path().":../:../."); require("inc1.php"); inc1.php: require("...

Adding my custom PHP Library in include_path

I want to add my PHP library file to be included in include_path, so that i can access it from anywhere in my application running on that server. I tried adding it as per the syntax for include_path in php.ini But its not working. I tried get_ini("include_path"); and got the value perfectly. But my functions are not inlcuded in my applic...

new Zend_Loader_Autoloader not finding files

I just upgraded from ZF 1.7 to ZF 1.9, and almost everything works fine... except for Autoloader. Old: require_once('Zend/Loader.php'); Zend_Loader::registerAutoload(); New: require_once 'Zend/Loader/Autoloader.php'; $loader = Zend_Loader_Autoloader::getInstance(); $loader->registerNamespace('MySiteName_'); $loader->setFal...

Fatal error: Class 'Zend_Controller_Action' not found

I've found some answers that are closely related to this problem, but I still can't get it resolved. I believe folks are saying that something is not correct with my include path, but I've tried all resolutions I could find to no avail. Here's the error: Fatal error: Class 'Zend_Controller_Action' not found in /Users/*me*/Sites/*site*/...

Question about the PHP include statement

I'm looking through the Zend_View source and I see this: include 'zend.view://' . func_get_arg(0); what does the string "zend.view://" represent and how would the include statement resolve that in php? ...

Symfony Fails opening my sfDoctrineDatabase.class.php

My problem is very simple, yet I feel lost while looking at it ... I am currently working on a Symfony project located on an SVN repository. It has worked well all day but suddenly it crashed... Now I cant launch any page of my site. They all return me the same error message Fatal error: sfAutoload::require() [function.require]: Faile...

Proper way to set PHP include path for *Nix and Windows

Is this the proper way to define an include path for both *nix and Windows? define( 'INCPATH', realpath( dirname( __FILE__ ) ) . '/' ); Note the trailing forward-slash I included above. Is the forward-slash for includes/requires the same for both OS's, as well? EDIT (UPDATED WITH ANSWER): From what I can gather, my code below is the...

php require_once path confusion

Hi, I was writing an web app in php, when i encountered a strange situation. I wish to clear my confusion. To illustrate my problem, consider a web app of this structure: / index.php f1/ f1.php f2/ f2.php contents of these files: index.php: <?php require_once("f1/f1.php"); ?> f1.php: <?php require_onc...

PHP include_once not working for file in parent directory

I just started working on a site that has been passed down to me that isn't working. I've found that there's a problem when in /admin/index.php it tries to instantiate an instance of /classes/admin.php. However, if I copy /admin/index.php to /admin-index.php, it can instantiate the class just fine. Also, if I move /classes/admin.php into...

Something wrong with include_path in Zend Framework

Getting this error: Fatal error: require_once() [function.require]: Failed opening required 'db/db.php' (include_path='/home/domain.ru/testerier/sites/application/../library:/home/domain.ru/testerier/sites/library:.:/usr/local/lib/php;/home/domain.ru/testerier/sites/application/models') in /home/domain.ru/testerier/sites/www/index.php o...

What would a script to replace \ with / in many files look like?

Yes, this is a really lazy question but I figure this is problem that people have often enough that someone here would have something already written to share. I have a ton of C files with #include statements using Windows relative paths. I'm working on compiling the code on other operating systems (immediately, on my OS X development m...

Include_Path Zend_Framework

Error: [2] require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory /var/www/vhosts/localhost/httpdocs/public.:./var/www/vhosts/localhost/httpdocs/public/../library:./var/www/vhosts/localhost/httpdocs/public/../model:. defined('SITE_ROOT') ? null : define('SITE_ROOT',$_SERV...

How to include file outside document root?

Hey, What I want do to is to include 'file1.php' from 'domain1' into 'file2.php' on 'domain2'. So what I figured I should do is something like this: file2.php require_once '/var/www/vhosts/domain1/httpdocs/file1.php'; But this won't work for reasons I can't truly grasp. So what I did was to add my path to the include path. Something ...

How do I include Zend Framework libraries in my domain?

Locally, on my xampp installation, the Zend folder is under PEAR\Zend, and Pear is in the include path. So when I do require_once "Zend\Date.php" there is no problem. However, on my domain (Hostmonster), that's not the case. I have no idea where the Zend folder is, although doing phpinfo(); seems to indicate that Zend Framework is defi...

PHP include file problem

Hi there again. I have a problem with including files on remote server (but on my local Windows PHP+Apache configuration it works fine...). Problem occurs when I try to include file from included file like this: Contents of index.php: <?php include("Dir1/File1.php"); ?> Contents of Dir1/File1.php: <?php include("File2.php"); inc...

Setting custom php include path in .htaccess on mac os x

in /Users/username/Sites/somesite/.htaccess I have AllowOverride All php_value include_path ".:/Users/username/Sites/somesite/inludesFolder:/usr/lib/php" I have also modified /etc/apache2/httpd.conf to AllowOverride All and restarted websharing, but it's not finding the additional include path. I'd like to avoid modifying t...

What is the right path for PHP includes on a Mac?

Running Mac OS X 10.5.8, with PHP 5.2.11 Pre-installed. Using Coda 1.6.10. I'm writing PHP files, and then preview them running from file, not server. This was working fine till I tried PHP includes. These don't work as a relative path, only as an absolute from the root of the drive. Is there any way I can use statements like incl...

Include path of php.ini ignored by Eclipse

Hi all, I have a PHP script to run. If I run it from the command line, it works fine (include path is set correctly). If I want to run it inside Eclipse (Run as script), then the PHP include path of my php.ini is replaced by Eclipse, with all the libraries I've added to the project. I've configured my PHP executable in Eclipse. I've ...