Welcome Guest, Not a member yet? Register   Sign In
moving application and system outside root
#1

[eluser]zeromechanic[/eluser]
Maybe someone can push me in the right way.

I've made an application in CI210, working great

When i put the system and application folders outside the public_html,
changed the path's in index.php

Site is working fine, only fileupload doesnt work anymore.
several php errors : access denied


when i return the 2 folders into public, errors are gone.

using:
CI210
wiredesigns HMVC
in this case the file upload class from CI

server is php53(-cgi) with suphp enabled (activated through an addhandler in .htaccess)
normal config is php52 as apache_mod
#2

[eluser]CroNiX[/eluser]
Is the folder you are uploading to publicly accessible?
#3

[eluser]zeromechanic[/eluser]
not sure.

If I put de folders into de public html, everything is working as it should.
uploading, resizing etc.

but when outside the public html, errorsssss

config :
public_html->.htaccess->addhandler php53 (
which activates php_cgi-suphp, sow no 777 chmod needed.
chmod higher than 755 and 644 gives 500 server error, due to the suphp)
)

sow basicly under public_html it is writable, since there are no errors when i put the system/appl folder under the public_html.

the errors came when i put the folders above the public_html.


#4

[eluser]zeromechanic[/eluser]
the folder i upload to is in the public_html,
only the appl and system folders are above the public_html
#5

[eluser]zeromechanic[/eluser]
sorry to bump

is there no CI die-hard that can give some advise??

asked my hoster:

"it'technincal not possible to do this. the site has to be in the public_html"

duh, site IS working, almost everything. The (admin) uploads not, permission errors

chmod 777 is not possible -> working with suPHP (script/me is owner, not apache)
#6

[eluser]CroNiX[/eluser]
Here is a basic setup on my server...
Code:
/home/site_name/system (CI system dir, 1 level below public_html)
/home/site_name/application  (CI application dir, 1 level below public_html)
/home/site_name/public_html (public web folder)
/home/site_name/public_html/.htaccess (htaccess for CI)
/home/site_name/public_html/index.php (ci index.php)
/home/site_name/public_html/images/
/home/site_name/public_html/js/
/home/site_name/public_html/css/

And change these paths in my index.php:
Code:
//$system_path = 'system';  (Original)
$system_path = '/home/site_name/system';

//$application_folder = 'application'; (Original)
$application_folder = '/home/site_name/application';
It works.
#7

[eluser]Aken[/eluser]
There's probably an issue with relative paths somewhere, then. You'll likely need to go in and change your upload paths and whatnot.
#8

[eluser]zeromechanic[/eluser]
whaaaaa

@Aken

many thanks for pointing me to the right direction.

used
Code:
$this->imdir = realpath(APPPATH . '../upload/images/FOLDER');

stupidstupid :ahhh: :ahhh: , never changed this to a doc-root.

changed to
Code:
$this->imdir = realpath($_SERVER['DOCUMENT_ROOT'] . '/upload/images/FOLDER');

and its is uploading, resizing, and all

thnx.

so i can reply to my hoster that it is POSSIBLE to do this WinkWink

@CroNiX
I use the same config.


MANY THANKS.




Theme © iAndrew 2016 - Forum software by © MyBB