Page 1 of 1

How to setup the "include_path" in a Linux shared host

Posted: Mon Feb 15, 2010 8:35 pm
by xtiano77
Hello,

I seem to have a hitch on my get along when working with "namespaces". I am working on a personal web site and would like to try the "namespace" feature; however, I can't get it to work. I tried modifying the "include_path" by adding ".:/home/myname/com". This is what my files look like:

"/home/myname/com/page/BasicPage.php"

Code: Select all

 
<?php
     namespace "page";
     class BasicPage {
          private $_pageTitle;
 
          public function __construct($pageTitle){
               $this -> _pageTitle = $pageTitle;
          }
 
          // rest of the class code...
     }
?>
 
"/home/myname/public_html/index.php"

Code: Select all

 
<?php
     include "page";
     $page = new page::BasicPage("Page Title");
     // rest of the objects...
?>
 
My site is hosted on a shared server, not a dedicated one. Can anyone help me out with this? Thanks in advance for your help.

Re: How to setup the "include_path" in a Linux shared host

Posted: Wed Feb 17, 2010 5:18 pm
by xtiano77
Well, after looking high and low I decided to call the hosting company and they told me that unless I get a dedicated server I cannot get that feature to work. I guess that answers the question. Although there were no replies I would like to thank those who took the time to read it.

Re: How to setup the "include_path" in a Linux shared host

Posted: Wed Feb 17, 2010 8:28 pm
by John Cartwright
Have you tried using set_include_path()?

Code: Select all

set_include_path(get_include_path() . PATH_SEPARATOR . '/home/myname/com');