document-root

PHP - Document_Root vs Sub-Domains

廉价感情. 提交于 2020-01-03 03:46:06
问题 I have the following code in my configuration file to establish the root path which is then used throughout the application: define('ROOT_PATH', $_SERVER['DOCUMENT_ROOT'].'/MyAppFolder/'); The problem is that it does not seem to work with sub domains. if I try to include my configuration file into a PHP file that is on the sub domain, naturally, I get an error. How can I get around this problem? How can I establish a root path that allows sub domains? I've never done this before so I haven't

PHP strange DOCUMENT_ROOT

妖精的绣舞 提交于 2020-01-01 12:32:51
问题 So basically, I'm writing a framework, and as part of it features, it's supposed to provide a set of well-established URIs/paths to the end-developer. Some two of these paths make use of $_SERVER['DOCUMENT_ROOT'] : /** * Absolute filesystem path to web root install (aka docroot). * @example "C:/wamp/www" OR "/home/visitgoz/public_html/" */ CFG::set('ABS_WWW', str_replace( $tmpseps, DIRECTORY_SEPARATOR, truepath($_SERVER['DOCUMENT_ROOT']).'/' ) ); /** * K2F path relative to web root. *

Change approot path of Windows Azure WebRole

南楼画角 提交于 2019-12-25 04:20:07
问题 How is it possible to change the default approot path? E.g. I want to run a PHP Framework whose web root is a sub folder: symfony |_ app |_ bin |_ src |_ web <- Web root |_ index.php The web root of the WebRole is there: WebRole <- Web root |_ bin |_ php |_ resources |_ WindowsAzureSDKForPHP |_ diagnostics.wadcfg |_ Global.asax |_ Web.config |_ index.php ServiceConfiguration.cscfg ServiceDefinition.csdef When bringing both togehter I get: WebRole |_ bin |_ php |_ resources |_

Modify document root for nginx proxy under plesk

余生长醉 提交于 2019-12-22 09:28:25
问题 I use Plesk with nginx as proxy, which is working good. I installed laravel php framework on a subdomain. the framework provides a direcotry "public" for public files, so I changed document_root with a custom vhost.conf file this way: DocumentRoot "/var/www/vhosts/example.com/laravel.example.com/public" Now apache is aware of this, PHP files working without any problems, but not the static files which are handeled via nginx, I get 404 not found because I must also reconfig the document_root

ProxyPass and DocumentRoot on one domain

牧云@^-^@ 提交于 2019-12-21 03:21:51
问题 Let's say I have the following configuration: <VirtualHost domain.com> # Server names, admins, logs etc... ProxyVia On ProxyRequests Off <Location "/"> ProxyPass http://localhost:8080/tomcat-webapp/ ProxyPassReverse http://localhost:8080/tomcat-webapp/ Order allow,deny Allow from all </Location> </VirtualHost> Now, I want the address domain.com/forum to display conent of my MyBB forum, which files are inside /var/www/forum directory. How to accomplish this? 回答1: Actually, I resolved this

You don't have permission error in Apache in CentOS

烈酒焚心 提交于 2019-12-21 01:41:12
问题 I have installed apache 2.2 in centos 6. Everything worked fine when the apache folder was at its default location /var/www/html . Then I configured a Virtual host inside my users home folder. After that apache started showing Forbidden You don't have permission error when I tried to go to localhost or 127.0.0.1 from browser. this is the code i used in httpd.conf <VirtualHost *:80> DocumentRoot "/home/anjan/workspace/mfs" ServerName anjan-centOS <Directory "/home/anjan/workspace/mfs"> Options

PHP XAMPP Server DOCUMENT_ROOT folder structure

梦想与她 提交于 2019-12-19 10:18:36
问题 So this is my first time creating a test site with xampp. I originally had all my php files in one folder and just recently decided to organize the data (yes, hindsight i should've started with an organized folder structure.) Anyways, I have my setup like this: " [ ] " implies it is a FOLDER Installed on my C:\ drive [xampp] -[htdocs] --[QMS] ---[rev3] ----[css] ----[js] ----[DPU] ----[login] ----index.php ----header.php ----config.php In my "config.php" file I tried to define a root path

$_SERVER['DOCUMENT_ROOT'] returns path with repeated directory name

南笙酒味 提交于 2019-12-13 19:14:54
问题 I am seeing a strange behavior when accessing $_SERVER['DOCUMENT_ROOT'] on a subdomain. It contains a duplicate folder name which does not exist. Here is the the relevant output of $_SERVER : [DOCUMENT_ROOT] => /var/www/sub.domainname.com/sub.domainname.com [SCRIPT_FILENAME] => /var/www/sub.domainname.com/index.php It should be: [DOCUMENT_ROOT] => /var/www/sub.domainname.com Here is the virtual host configuration: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName sub.domainname

Differences in declaring your root directory in HTML

ぐ巨炮叔叔 提交于 2019-12-13 11:50:40
问题 This has been bugging me for a long time so I need to ask the question. What is the difference between / and ./ , is it just down to server settings? For example, if we were looking for an images folder in the root directory we would write: <img src="/images"> However, another server will only accept it as follows: <img src="./images"> It's not a biggie, but in an ideal world I'd like to think I could transfer my sites to another server relatively easily without having to update minor details

getting a file from outside the document root. PHP

浪子不回头ぞ 提交于 2019-12-13 04:17:13
问题 I am currently storing docx files and pdf files in a user upload folder outside the doc root. I intend for these files to be downloaded via a db link to the heavily scrambled file name. Previously I have only obtained data from files outside the root with PHP - is it possible to retrieve whole files from this area and if so how does one go about it. 回答1: <?php $file_id = $_GET['id']; $local_path = get_real_filelocation_from_id($file_id); readfile($local_path); The code for get_real