• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

PHP root folder

G

gusmanb

Guest
Hi.

I'm using Plesk 8.1 and got a weird behavior.

When PHP is used, when tried to acces to a file or directory on the web root folder (I.E.: c:\inetpub\vhosts\domainname\httpdocs\folder) using "/" (I.E.: /folder) the file/folder isn't found.
After some tries i've discovered "/" was pointing to "C:\" and not to the web root folder.

¿How can this be solved?
 
I'm working on figuring out the best way to reference the web root folder as well, but I know you can't simply use / to indicate the web root folder. The PHP parser will actually interpret this as the root of the file system. I know that on a Unix-based system, "/" is the root of the drive, and I believe the same is true in Windows. Thus "/" would mean the root of the C drive (or whatever drive letter the root partition is). This can be useful for including files outside of your web root that contain sensitive information you don't want publicly accessible from the web, such as a file containing database login information, etc. Perhaps the best way I know of so far is to either use relative URL's or use the public address such as http://www.someplace.com/somefolder/somedeeperfolder/somefile.php. As for relative URLs, let's say you have a file located at (webroot)/somefolder/somedeeperfolder/somefile.php. You could reference the folders (and thus files/folder in them) quite easily. "../" refers to the parent directory of the current working directory, or in this example, somefolder. "./" refers to the current working directory, or in this example, somedeeperfolder. You can use multiple "./"s to keep going up a level. So for this example, the webroot would be referenced as "./././". I hope this helps :)
 
Back
Top