HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Moving framework to shared lib (http://www.howtoforge.com/forums/showthread.php?t=53777)

MetZ 14th August 2011 14:11

[Solved] Moving framework to shared lib
 
Hi..

I am wondering how I can move my cakephp framework outside the "regular" web folder to share it with all cake apps on system?

Example:
cake location: /usr/local/lib/cakephp/cake_1_3_6/*.php

ISPConfig PHP open_basedir => added => :/usr/local/lib/cakephp/cake_1_3_6

and then to my app/webroot/index.php
Code:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
        define('CAKE_CORE_INCLUDE_PATH', DS.'usr'.DS.'local'.DS.'lib'.DS.'cakephp'.DS.'cake_1_3_6');
}

Should this not work? or am I missing something?

Thanks for any and all help provided!!

-Tom

till 14th August 2011 21:06

This might cause problems with file permissions, as files should be owned by the user of a website and as every website has its own user, you might get problems depending on the php mode that you use. You will have to try if it works.

MetZ 15th August 2011 23:24

Hi..

Thanks for your reply ;p

I have been trying to sort out this myself.. and I have solved it.

Logged in and su - to get root access

1: Moved cake to: /usr/share/cakephp/cake
2: Moved vendors to: /usr/share/cakephp/vendors
3: Checked ownership of vendors & cake + sub-files (ls -all = root:root)
5: added /usr/share/cakephp to the Options :: PHP open_basedir in ISPConfig
6: Saved website

7: Edited app/webroot/index.php
Code:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
        define('CAKE_CORE_INCLUDE_PATH', DS.'usr'.DS.'share'.DS.'cakephp');
}

And voila, it is working.. two separate domains/apps, using same cake core. Perfect.

Hope this can help anyone else :D

Edit: Using Fastcgi + suexec. Tried with suPHP also,, working just fine.
Edit2: The problem from first post and the setup not working, was that my app/webroot/index.php was checking for a "cake" dir and not the cake_1_3_6, further down in config. Also, I did not realize that "vendors" also was needed!

-Tom


All times are GMT +2. The time now is 10:36.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.