#1  
Old 18th January 2013, 21:37
markshorter markshorter is offline
Junior Member
 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot use chdir

If I run this simple script:

Code:
<?php

// starting directory
echo getcwd() . "<br />";
chdir('/var/');
// new directory
echo getcwd() . "<br />";

?>
The same directory is printed twice. In other words "chdir" isn't changing directory as intended. Have I missed something when installing ISPConfig3 on Debian Squeeze?
Reply With Quote
Sponsored Links
  #2  
Old 21st January 2013, 10:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,034
Thanks: 826
Thanked 5,382 Times in 4,229 Posts
Default

Wre do you execute this script, in a website? The /var/ directory is outside of the allowed paths of a website, so you can not change to that directory. If you want to allow access to /var, then add /var to the open basedir path settin on the options tab of this website.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 22nd January 2013, 05:02
markshorter markshorter is offline
Junior Member
 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The /var directory was only part of my testing what was possible, but thank you for your comments. This was an interesting challenge, and more by luck than good judgement I found the settings you mentioned a few hours before your post.

If any other reader doesn't know (and I didn't at first), go to Sites and select the domain of interest. On its Options tab you will find a page on which you can enter a few of your own custom settings,
one of which is the open_basedir declaration. This field starts life with an ISPConfig default and it was this default upsetting my trial. After some experimenting, here's some things I discovered:

1. The default includes 10 directory paths. When I changed it to just the 3 I wanted everything I tested worked fine on a medium sized Drupal site with lots of symlinks - so I don't know why the default has so many paths. Legacy thing that hasn't been reviewed lately perhaps?

2. If you delete all the defaults, maybe as part of your own testing, be aware that ISPConfig will reinstate all 10 default paths again. I don't like any software being that dictatorial, but the key here is that it will only reinstate the defaults if you leave the field empty, so put something in there to suppress this unwelcome feature.

And the reason I described it as a challenge to find is because of an odd thing. Whatever appears in this field does not seem to be written to any standard apache conf file that I could find - hence my original post. The odd thing is that this Options page includes a panel for you to enter your own Apache Directives. Anything you add here is written out to the vhost configuration file for this domain.

Yes, it's odd that one of your custom fields finds its way into a standard config file but another doesn't - not just odd, but confusingly inconsistent. Perhaps it might be good if all the user changeable fields on this Options page could be treated in a consistent manner - preferrably all written out to config files.

Last edited by markshorter; 22nd January 2013 at 05:11.
Reply With Quote
  #4  
Old 22nd January 2013, 08:59
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,034
Thanks: 826
Thanked 5,382 Times in 4,229 Posts
Default

Quote:
1. The default includes 10 directory paths. When I changed it to just the 3 I wanted everything I tested worked fine on a medium sized Drupal site with lots of symlinks - so I don't know why the default has so many paths. Legacy thing that hasn't been reviewed lately perhaps?
The paths are required. Maybe not on your system but on others. Btw, drupal runs fine out of the box with the default paths, installed it for a client a few weeks ago

Quote:
2. If you delete all the defaults, maybe as part of your own testing, be aware that ISPConfig will reinstate all 10 default paths again. I don't like any software being that dictatorial, but the key here is that it will only reinstate the defaults if you leave the field empty, so put something in there to suppress this unwelcome feature.
Naming ispconfig dictatorial is just funny. Your post shows just that you dont know much about hosting or ispconfig.

1) If you want to change the default of the open_basedir paths, then edit it underSystem > Server config
2) The open_basedir path is never empty, to disable it, insert the word "none" like it is decribed in the php documentation.

Quote:
And the reason I described it as a challenge to find is because of an odd thing. Whatever appears in this field does not seem to be written to any standard apache conf file that I could find - hence my original post. The odd thing is that this Options page includes a panel for you to enter your own Apache Directives. Anything you add here is written out to the vhost configuration file for this domain.
Are you aware how php is configred in apache in different modes? php settings are only in apache file if mod_php is used. If you use php-fcgi, cgi or suphp, then values are stored either in a custom php.ini or they are set in the fcgi starter script.

Quote:
Yes, it's odd that one of your custom fields finds its way into a standard config file but another doesn't - not just odd, but confusingly inconsistent. Perhaps it might be good if all the user changeable fields on this Options page could be treated in a consistent manner - preferrably all written out to config files.
Its absolutely consistent when you know that different php mpdes ahve different ways of configuration.

So before you blame a software that it does something wrong,you might want to ask or read the php and apache documentation in details
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 22nd January 2013, 16:41
markshorter markshorter is offline
Junior Member
 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Well, didn't I display my ignorance in my previous post. But your sentence saying "Your post shows just that you dont know much about hosting or ispconfig" was apparent enough to all without the unkindness of bluntly saying it. Your post would have been just as useful and informative without underlining my shortcomings.

That said, I did start it with unfounded observations of my own, which, based on learning from your brief explanations, I withdraw unreservedly. ISPConfig is evidently clever, well thought through software in ways that I am only beginning to learn and understand. I'm working on it.

My sites were set up to use the default of fastcgi and now that you've guided me in the right direction it is plainly obvious where the open_basedir settings are written - in a hidden fcgi scripts file just above the site's document root.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users.....: pop3d-ssl: chdir No such file or directory dinnouti HOWTO-Related Questions 17 11th May 2009 00:35
-ERR chdir Maildir failed Virtual Users And Domains With Postfix, Courier And MySQL jacob Installation/Configuration 18 4th November 2008 13:22
debian etch courier pop3 issue docean Installation/Configuration 6 20th March 2008 15:38
virtual user & domain problem laser144 Server Operation 16 27th January 2008 11:24
Unable to send and receive mail in command line mode kdclaver Installation/Configuration 7 26th July 2007 19:45


All times are GMT +2. The time now is 22:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.