Darghon Posted February 21, 2012 Share Posted February 21, 2012 Hello all, I have a server setup that contains an web application at location x, and a "subdomain" at location y, with a public_html symlink to location x. Now, I've added a virtual host to the system pointing to the symlink in subdomain y. The config files that the application requires to work (subdomain specific) are contained on the same leven as the symlink, so the application would need to move up 1 directory to access the config data. require(../config/config.php) Now the server says it can't access the file, even though it is there. I've managed to fix the problem for now by using this little piece of code: require_once(str_replace('public_html','config/config.php',$_SERVER['DOCUMENT_ROOT'])); But I would guess that doing require('../config/config.php') would do the same... why not? and if possible how can I fix this, because the subdomain folder contains more then just the config data, (also user files etc...) so it would be best if the symlink would work as expected... thx in advance, and if anything is unclear about my question, do let me know, and I'll try to clearify everything. Vhost file (censored): <VirtualHost *:80> ServerName demo.somedomain.org DocumentRoot /home/demo.somedomain.org/public_html <Directory /home/demo.somedomain.org/public_html/> Options Indexes +FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/app/demo.somedomain.org.error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/app/demo.somedomain.org.access.log combined </VirtualHost> Quote Link to comment 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.