Welcome Guest, Not a member yet? Register   Sign In
One library Multiple website
#1

[eluser]dorwin[/eluser]
Hello,

we have a virtual server, folder are like that :

/usr/home/vxxxx/html

xxxx is id of a client, website or whatever.

On ftp, vxxxx/ is base path, and /html is public file where the website is.

I know i am not clear, this is an example :

http://www.example.com : files are on /usr/home/v1234/html/{index.php}..
and
http://www.example2.com : files are on /usr/home/v5678/html/{index.php}..

Files of both website are on the same server.

My question is, is it possible to share CI library ?

I tried to upload system folder on my server : /usr/home/v1076/codeigniter/system,
and application folder on /usr/home/v1064/html/test/application

And few code on index.php :
Code:
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1')
    define ('LOCAL', true);
else
    define ('LOCAL', false);
    
$path = (LOCAL)?'C:\wamp\www\librairies\codeigniter':'/usr/home/v1076';
set_include_path(get_include_path() . PATH_SEPARATOR . $path . PATH_SEPARATOR . '/home/v1076');

$system_folder = "/codeigniter/system";

I don't change anything else but it is not working.

Classic error :
Fatal error: main(): Failed opening required '/codeigniter/system/codeigniter/CodeIgniter.php' (include_path='.:/usr/local/lib/php:/usr/home/v1076:/home/v1076') in /usr/home/v1064/html/test/index.php on line 125

Is it possible ?

Thanks !
#2

[eluser]dorwin[/eluser]
Ok My misstake : $system_folder = "codeigniter/system"; (no slash)

I have safe_mode restriction now, seems to be fine Smile
#3

[eluser]danmontgomery[/eluser]
You can move the system folder above web root, and you just need to change the $system_folder to point to that absolute location...

For example, if you put the system folder at: /usr/home/codeigniter/system, you just need to change $system_folder in all of your index.php files to:

Code:
$system_folder = "/usr/home/codeigniter/system";




Theme © iAndrew 2016 - Forum software by © MyBB