471,123 Members | 830 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 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 4228
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Tom | last post: by
4 posts views Thread by Chris | last post: by
4 posts views Thread by Ronald Raygun | last post: by
6 posts views Thread by Jeff | last post: by

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.