472,989 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 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 4297
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.