• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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