Search code examples
wordpresspathbitnami

What is the correct path to a file "below" the root?


I have a bitnami Wordpress installation. When navigating via FTP, the directory tree to Wordpress is home/bitnami/apps/wordpress/htdocs. When browsing, this acts as the root directory.

I have added several packages I need to use via Composer (AWS SDK, Facebook SDK, etc.) Composer installs these packages at home/bitnami/vendor. I can't seem to find the right path to these files.

I created a file called "test.php" in a subdirectory of the Wordpress root called test-dir (home/bitnami/apps/wordpress/htdocs/test-dir/test.php). I want to require the file home/bitnami/vendor/required.php in test.php. What would be the correct path to required.php? Here is my first guess (which throws an HTTP ERROR 500):

test.php:

<?php
require '../../../../vendor/required.php';

What is the correct path?


Solution

  • The simple solution was to use the absolute path:

    <?php
    require '/home/bitnami/vendor/required.php';