[Solar-talk] How to make Solar work if you install it in a subfolder of server root?
Jeff Surgeson
solar at 3hex.com
Thu Aug 17 05:23:32 PDT 2006
> I am currently doing a lot of projects, so i cannot afford to put
> index.phpat the server root.
> So my structure is as follows:
> /public_html/project1/public_html/index.php
> /public_html/project2/public_html/index.php
> ....
> /public_html/solar/public_html/index.php
>
> So to reach solar index.php, my url would be
> http://localhost/solar/public_html/ instead of simply http://localhost/
>
> However, i can't seem to find any way i can tell Solar where my public root
> is.
I also work with a number of projects in my root folder so had the same
problem at first. You need to add your solar vendor dir path and the dir
where your index.php file is to your include path. This is what I put in my
index.php file to get it to work, obviously replace with your own specifics.
I also do not install solar via pear but download and copy Solar to a
directory in my web root. This is not the recommended way it just works for
me as I do not control my remote web server so need to add solar myself.
define('WEB_ROOT', '/var/www/localhost/htdocs' );
define('SITE_DIR', '/project1/public_html/'); //where you index.php is
define('LIB_ROOT', WEB_ROOT .'/Solar');
define('VEN_ROOT', WEB_ROOT .'/dir_where_solar_vendor_app_files'); //where
your app files are.
set_include_path(
WEB_ROOT . PATH_SEPARATOR .
SITE_DIR . PATH_SEPARATOR .
LIB_ROOT . PATH_SEPARATOR .
VEN_ROOT . PATH_SEPARATOR
);
// solar config path
define('SOLAR_CONFIG_PATH', VEN_ROOT .'/Solar.config.php');
// Load and start Solar
require_once('Solar.php');
Solar::start();
// Instantiate and run the front controller
$front = Solar::factory('Solar_Controller_Front');
$front->display();
// Done!
Solar::stop();
--
Jeff Surgeson / South Africa
More information about the solar-talk
mailing list