JetJagger Posted October 12, 2012 Share Posted October 12, 2012 Thank you in advance... 1) I have a directory called /construct/ located here above web root: /home/xxxx/construct/ 2) I have the /construct/ directory symlinked to multiple subdomains so the path looks like so: /home/xxxx/public_html/sampleaccount/construct/ (wherein 'sampleaccount' is a subdomain) *NOTE: All directories and files in each subdomain are identical except for a few account-specific customization files. 3) /construct/ contains files that use <?php include ?> to pull-in content files from a directory called /bodyCopy/ which is located inside every subdomain account. For example: <?php include("/bodyCopy/copy-content.php"); ?> ..is intended to point to a file here... /home/xxxx/public_html/sampleaccount/bodyCopy/copy-content.php The issue that I am having is that the PHP Include file is trying to search here: /home/xxxx/construct/bodyCopy/ (which does not exist) ...instead of here... /home/xxxx/public_html/sampleaccount/bodyCopy/ (which does exist) ...for this file... copy-content.php I read somewhere that symlinked files are not capable of following relative paths in the directories to which they are symlinked. Even so, I have symlinked FCKEditor/CKEditor to subdomain accounts been able to pull copy-content.php files into it which are specific to its subdomain account. Is there a way to eloquently force or command the PHP Include (within the symlinked files) to search the /bodyCopy/ directory within the target subdomain(s) instead of the source directory above web root? Once again, I thank you all in advance for any assistance that you can provide. --JET-- Quote Link to comment https://forums.phpfreaks.com/topic/269397-how-do-i-get-symlinked-files-to-php-include-from-target-directory/ Share on other sites More sharing options...
requinix Posted October 13, 2012 Share Posted October 13, 2012 Use an absolute path. Easiest way would be with the DOCUMENT_ROOT. <?php include($_SERVER["DOCUMENT_ROOT"] . "/bodyCopy/copy-content.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/269397-how-do-i-get-symlinked-files-to-php-include-from-target-directory/#findComment-1384913 Share on other sites More sharing options...
JetJagger Posted October 13, 2012 Author Share Posted October 13, 2012 That worked beautifully! Such a simple solution. Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/269397-how-do-i-get-symlinked-files-to-php-include-from-target-directory/#findComment-1384921 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.