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

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
xtiano77
Forum Commoner
Posts: 72
Joined: Tue Sep 22, 2009 10:53 am
Location: Texas

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

Post 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.
xtiano77
Forum Commoner
Posts: 72
Joined: Tue Sep 22, 2009 10:53 am
Location: Texas

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

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

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

Post by John Cartwright »

Have you tried using set_include_path()?

Code: Select all

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