Re: [PHP] Re: How can I stop PHP from resolving symlinks?

2006-03-01 Thread Chris

Roy Souther wrote:
It is and the key word here is Follow as in resolve the real file 
location before parsing.


This is clearly an Apache problem. I have asked this question on a few 
Apache forums and lists now and have not had any response.


Is there any way to make Apache parse the files where it finds them and 
not go looking for the real file?


No, because it has to verify the file exists in the original place etc 
first.


Just like in shell, if you have a symlink from /symlink to /realfile - 
the o/s has to verify that the /realfile exists before you can use /symlink.




On Thu, 2006-02-23 at 15:59 -0700, Joel Leibow wrote:

You need to check your httpd.conf and make sure the Options FollowSymLinks 
is set for the server.  Check the apache documentation for further 
information.


Joel Leibow

Roy Souther [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am trying to stop PHP from resolving symlinks. I have a PHP CMS that I use 
to host dozens of sites using Apache virtual hosting features. I need all 
the sites to run the exact same PHP CMS code but use their unique 
directories to host the different config files. The problem is that the PHP 
scripts are running from the directory that the links point to and not the 
directory where the site is. The big problem with that is the CMS tries to 
read a configuration file that is in a relative location to the PHP script 
like ../config.php.


[EMAIL PROTECTED] ls -l /usr/local/cms
-rw-r--r--  1 user users 20 Jan 16 02:17 index.php
drwxr-xr-x  9 user users 4096   Feb 22 16:40 admin
[EMAIL PROTECTED] ls -l /vhost/test01.com/var/www/html/
-rw-r--r--  1 user users 20 Jan 16 02:17 config.php
lrwxrwxrwx  1 root root  31 Feb 22 14:05 index.php - 
/usr/local/cms/index.php
lrwxrwxrwx  1 root root  31 Feb 22 14:05 admin - 
/usr/local/cms/admin

[EMAIL PROTECTED] cd /vhost/test01.com/var/www/html/admin/
[EMAIL PROTECTED] pwd
/vhost/test01.com/var/www/html/admin
[EMAIL PROTECTED]

Bash is doing what I need. It sees the current directory as the full path of 
the symlink.


The admin.php at this point only has system(pwd); in it and it prints out 
/usr/local/cms/admin as the directory it is in, not what I want. It will 
never see the ../config.php file.


I tried doing this
chdir ($_SERVER[DOCUMENT_ROOT]./.$_SERVER[REQUEST_URI]);
but it still resolves the link and does not accept the path that I 
constructed.


How can I make PHP use the symlink and stop trying to resolve the original 
files?



Royce Souther
www.SiliconTao.com http://www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG. 



_Royce Souther mailto:[EMAIL PROTECTED]_
_www.SiliconTao.com http://www.SiliconTao.com_
Let Open Source help your business move beyond.

For security this message is digitally authenticated by _GnuPG 
http://www.gnupg.org_.








--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: How can I stop PHP from resolving symlinks?

2006-02-28 Thread Roy Souther




It is and the key word here is Follow as in resolve the real file location before parsing. 

This is clearly an Apache problem. I have asked this question on a few Apache forums and lists now and have not had any response.

Is there any way to make Apache parse the files where it finds them and not go looking for the real file?

On Thu, 2006-02-23 at 15:59 -0700, Joel Leibow wrote:


You need to check your httpd.conf and make sure the Options FollowSymLinks 
is set for the server.  Check the apache documentation for further 
information.

Joel Leibow

Roy Souther [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am trying to stop PHP from resolving symlinks. I have a PHP CMS that I use 
to host dozens of sites using Apache virtual hosting features. I need all 
the sites to run the exact same PHP CMS code but use their unique 
directories to host the different config files. The problem is that the PHP 
scripts are running from the directory that the links point to and not the 
directory where the site is. The big problem with that is the CMS tries to 
read a configuration file that is in a relative location to the PHP script 
like ../config.php.

[EMAIL PROTECTED] ls -l /usr/local/cms
-rw-r--r--  1 user users 20 Jan 16 02:17 index.php
drwxr-xr-x  9 user users 4096   Feb 22 16:40 admin
[EMAIL PROTECTED] ls -l /vhost/test01.com/var/www/html/
-rw-r--r--  1 user users 20 Jan 16 02:17 config.php
lrwxrwxrwx  1 root root  31 Feb 22 14:05 index.php - 
/usr/local/cms/index.php
lrwxrwxrwx  1 root root  31 Feb 22 14:05 admin - 
/usr/local/cms/admin
[EMAIL PROTECTED] cd /vhost/test01.com/var/www/html/admin/
[EMAIL PROTECTED] pwd
/vhost/test01.com/var/www/html/admin
[EMAIL PROTECTED]

Bash is doing what I need. It sees the current directory as the full path of 
the symlink.

The admin.php at this point only has system(pwd); in it and it prints out 
/usr/local/cms/admin as the directory it is in, not what I want. It will 
never see the ../config.php file.

I tried doing this
chdir ($_SERVER[DOCUMENT_ROOT]./.$_SERVER[REQUEST_URI]);
but it still resolves the link and does not accept the path that I 
constructed.

How can I make PHP use the symlink and stop trying to resolve the original 
files?


Royce Souther
www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG. 










Royce Souther
www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG.













signature.asc
Description: This is a digitally signed message part


[PHP] Re: How can I stop PHP from resolving symlinks?

2006-02-25 Thread James Benson

is_link() perhaps ?



http://php.net/is_link



James

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How can I stop PHP from resolving symlinks?

2006-02-23 Thread Joel Leibow
You need to check your httpd.conf and make sure the Options FollowSymLinks 
is set for the server.  Check the apache documentation for further 
information.

Joel Leibow

Roy Souther [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am trying to stop PHP from resolving symlinks. I have a PHP CMS that I use 
to host dozens of sites using Apache virtual hosting features. I need all 
the sites to run the exact same PHP CMS code but use their unique 
directories to host the different config files. The problem is that the PHP 
scripts are running from the directory that the links point to and not the 
directory where the site is. The big problem with that is the CMS tries to 
read a configuration file that is in a relative location to the PHP script 
like ../config.php.

[EMAIL PROTECTED] ls -l /usr/local/cms
-rw-r--r--  1 user users 20 Jan 16 02:17 index.php
drwxr-xr-x  9 user users 4096   Feb 22 16:40 admin
[EMAIL PROTECTED] ls -l /vhost/test01.com/var/www/html/
-rw-r--r--  1 user users 20 Jan 16 02:17 config.php
lrwxrwxrwx  1 root root  31 Feb 22 14:05 index.php - 
/usr/local/cms/index.php
lrwxrwxrwx  1 root root  31 Feb 22 14:05 admin - 
/usr/local/cms/admin
[EMAIL PROTECTED] cd /vhost/test01.com/var/www/html/admin/
[EMAIL PROTECTED] pwd
/vhost/test01.com/var/www/html/admin
[EMAIL PROTECTED]

Bash is doing what I need. It sees the current directory as the full path of 
the symlink.

The admin.php at this point only has system(pwd); in it and it prints out 
/usr/local/cms/admin as the directory it is in, not what I want. It will 
never see the ../config.php file.

I tried doing this
chdir ($_SERVER[DOCUMENT_ROOT]./.$_SERVER[REQUEST_URI]);
but it still resolves the link and does not accept the path that I 
constructed.

How can I make PHP use the symlink and stop trying to resolve the original 
files?


Royce Souther
www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php