473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Virtual servers and $_SERVER[DOCUMENT_ROOT]

Hello,

I'm new to php and was wondering if someone could help me out with the best
way to accomplish this.

I have Solaris 9/Apache 1.3.31/PHP 5.1.4 that I compiled from source code
and installed.

I have multiple virtual web servers configured in httpd.conf and php scripts
run only if they are placed in my first VirtualHost DocumentRoot directory
as defined in httpd.conf:

<VirtualHost X.X.X.X:80>
DocumentRoot /usr/local/apache/sites/webdocdir
</VirtualHost>

I would like to get php scripts to run in one of my other virtual servers
defined in httpd.conf.

Right now, my $_SERVER[DOCUMENT_ROOT] gets defined (I think) from httpd.conf
such that it points to /usr/local/apache/sites/webdocdir. This I can see
from the results of a phpinfo().

Is there some way of configuring Apache and/or php so that I am not forced
to put php scripts in /usr/local/apache/sites/webdocdir?

thanks for any help,

George
Jun 23 '06 #1
2 4319
On Fri, 23 Jun 2006 13:51:18 -0400, George Zervakos wrote:
Hello,

I'm new to php and was wondering if someone could help me out with the best
way to accomplish this.

I have Solaris 9/Apache 1.3.31/PHP 5.1.4 that I compiled from source code
and installed.

I have multiple virtual web servers configured in httpd.conf and php scripts
run only if they are placed in my first VirtualHost DocumentRoot directory
as defined in httpd.conf:

<VirtualHost X.X.X.X:80>
DocumentRoot /usr/local/apache/sites/webdocdir
</VirtualHost>

I would like to get php scripts to run in one of my other virtual servers
defined in httpd.conf.

Right now, my $_SERVER[DOCUMENT_ROOT] gets defined (I think) from httpd.conf
such that it points to /usr/local/apache/sites/webdocdir. This I can see
from the results of a phpinfo().

Is there some way of configuring Apache and/or php so that I am not forced
to put php scripts in /usr/local/apache/sites/webdocdir?

thanks for any help,

George


The ScriptAlias directive will do this for you.;

Steve

Jun 24 '06 #2
George Zervakos wrote:
Hello,

I'm new to php and was wondering if someone could help me out with the best
way to accomplish this.

I have Solaris 9/Apache 1.3.31/PHP 5.1.4 that I compiled from source code
and installed.

I have multiple virtual web servers configured in httpd.conf and php scripts
run only if they are placed in my first VirtualHost DocumentRoot directory
as defined in httpd.conf:

<VirtualHost X.X.X.X:80>
DocumentRoot /usr/local/apache/sites/webdocdir
</VirtualHost>

I would like to get php scripts to run in one of my other virtual servers
defined in httpd.conf.

Right now, my $_SERVER[DOCUMENT_ROOT] gets defined (I think) from httpd.conf
such that it points to /usr/local/apache/sites/webdocdir. This I can see
from the results of a phpinfo().

Is there some way of configuring Apache and/or php so that I am not forced
to put php scripts in /usr/local/apache/sites/webdocdir?

thanks for any help,

George


George,

You might try alt.apache.configuration for some help.

It does work; I have my Apache set up with multiple virtual hosts and PHP works
fine in any directory in each host.

I don't know what you've got incorrect in your Apache configuration, but it's
not ScriptAlias.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tom | last post by:
I'm trying to dynamically adjust the path for one of my scripts using this: $script_path = str_replace( $_SERVER, "", dirname(realpath(__FILE__)) ) . DIRECTORY_SEPARATOR; The problem: the...
4
by: Chris | last post by:
I'm working on a large intranet group site with a lot of pages, file types, folders, subfolders, etc. I am using the include ('../includes/file.php') , but I would like to have a single snippet...
4
by: monomaniac21 | last post by:
Why does this find the file: <img src="<?=$_SERVER?>/images/viessmann_header_logo.gif"> But this does not? $right_content = $_SERVER."includes/content/content.php";
12
by: comp.lang.php | last post by:
Env: Windows XP, Apache 1.33, PHP 5.2.0 <? echo is_dir($_SERVER) . " for dir = " . $_SERVER); ?>
17
by: Paul | last post by:
On my development computer, I have virtual named host set up, like www.site1.lab. When I upload those to my web site for customer review under mywebsite.com/clients/site1/ it throws some of the...
4
by: Ronald Raygun | last post by:
I have just discovered that the value reported for $_SERVER by phpinfo is different from the value I obtain when I run the following: <?php echo $_SERVER ?> My natural assumption is to assume...
6
by: Jeff | last post by:
Is $_SERVER alway available? I ask this because I've seen on windows that the perl equivalent was missing. Is this settable and accessible the same way (ie not having to use global)? Jeff
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.