I have written some code for an image gallery, the code works perfectly if the application is installed in the document root folder. However various hosting companies such as C9 and many others create their do not create their sites in the DOCUMENT_ROOT. The apache server I am trying to get the app to work on has a DOCUMENT_ROOT of /user/local/websites/
I have used the command below that runs in index.php and gives me the correct path.
// full file path to app root directory
DEFINE("DOC_ROOT", dirname(__FILE__) . '/');
echo DOC_ROOT; // /home/name/public_www/subject/index.php
How can I change the statements below to use to use the output from the DEFINE command above?
$original_file = $_SERVER['DOCUMENT_ROOT'] . SITE_FOLDER_DIR . DIR_UPLOAD_IMAGE . $main_image;
$original_file_to = $_SERVER['DOCUMENT_ROOT'] . DIR_CREATE_THUMB . $main_image;