Not able to find a file residing two directories upDefault file permissions for php user www-datachange permission to read write and executeI can't get wordpress on working on a apache! Please help!Apache server root access from Netbeansvsftpd folder file permission in ubuntuApache Rewrite not working with domain name for Yii2 app in AWS Ubuntu OSCreate new ssh user account to access specific folder onlyCan hackers inject anything to the server outside /var/www/htmlWhy can't Apache2 look outside /var/www/html/ for a PHP file?

How can I filter an EntityClass by _not_ having a property?

Rational Number RNG

Can you identify this fighter aircraft?

Does animal blood, esp. human, really have similar salinity as ocean water, and does that prove anything about evolution?

Is the ''yoi'' meaning ''ready'' when doing karate the same as the ''yoi'' which means nice/good?

How can an immortal member of the nobility be prevented from taking the throne?

Why was the "Cave of the Patriarchs" forbidden to Jews?

For a command to increase something, should instructions refer to the "+" key or the "=" key?

The professor for one of my classes has no direction

Letters associated with prime numbers

What's a good strategy for offering low on a house?

If a tournament advertises G/30, can either player demand G/25 d5?

Permissions using a TYPE as a Table Valued Parameter

Why don't we say a blessing before giving charity?

What's the difference between a square and hexagonal Visit Pass in Singapore?

How can Edward Snowden be denied a jury trial?

Why does Bane's stock exchange robbery actually work to bankrupt Bruce Wayne?

Coworkers accusing me of "cheating" for working more efficiently

Pass variable to sed and change backslash to forward slash

How to discourage mundane play?

I am particularly fascinated by the Chinese character that is pronounced SHIN & means faith or belief

Did the Allies reverse the threads on secret microfilm-hiding buttons to thwart the Germans?

Artificially isolated pawn in the Caro-Kann

How much caffeine would there be if I reuse tea leaves in a second brewing?



Not able to find a file residing two directories up


Default file permissions for php user www-datachange permission to read write and executeI can't get wordpress on working on a apache! Please help!Apache server root access from Netbeansvsftpd folder file permission in ubuntuApache Rewrite not working with domain name for Yii2 app in AWS Ubuntu OSCreate new ssh user account to access specific folder onlyCan hackers inject anything to the server outside /var/www/htmlWhy can't Apache2 look outside /var/www/html/ for a PHP file?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2

















Currently, my directory's structure looks like this:



- project
- app
- Config
- file1.php
- file.txt


This project folder is in /var/www/html folder. I am including file.txt in file1.php using the following code.



require_once '../../file.txt';


The Problem is, it can't find the file even when it is there. This is working on my local system which has Ubuntu 18.04, but not on the server that has Ubuntu 19.04. The project is built using the CakePHP framework.



$ ls -ld /var/www/html/project /var/www/html/project/app 
/var/www/html/project/app/Config /var/www/html/project/file.txt
drwxr-xr-x 6 root root 4096 May 30 11:01 /var/www/html/project
drwxrwxr-x 13 root root 4096 May 29 08:09 /var/www/html/project/app
drwxrwxr-x 3 root root 4096 May 30 05:29 /var/www/html/project/app/Config
-rw-r--r-- 1 root root 3401 May 30 11:13 /var/www/html/project/file.txt









share|improve this question


































    2

















    Currently, my directory's structure looks like this:



    - project
    - app
    - Config
    - file1.php
    - file.txt


    This project folder is in /var/www/html folder. I am including file.txt in file1.php using the following code.



    require_once '../../file.txt';


    The Problem is, it can't find the file even when it is there. This is working on my local system which has Ubuntu 18.04, but not on the server that has Ubuntu 19.04. The project is built using the CakePHP framework.



    $ ls -ld /var/www/html/project /var/www/html/project/app 
    /var/www/html/project/app/Config /var/www/html/project/file.txt
    drwxr-xr-x 6 root root 4096 May 30 11:01 /var/www/html/project
    drwxrwxr-x 13 root root 4096 May 29 08:09 /var/www/html/project/app
    drwxrwxr-x 3 root root 4096 May 30 05:29 /var/www/html/project/app/Config
    -rw-r--r-- 1 root root 3401 May 30 11:13 /var/www/html/project/file.txt









    share|improve this question






























      2












      2








      2








      Currently, my directory's structure looks like this:



      - project
      - app
      - Config
      - file1.php
      - file.txt


      This project folder is in /var/www/html folder. I am including file.txt in file1.php using the following code.



      require_once '../../file.txt';


      The Problem is, it can't find the file even when it is there. This is working on my local system which has Ubuntu 18.04, but not on the server that has Ubuntu 19.04. The project is built using the CakePHP framework.



      $ ls -ld /var/www/html/project /var/www/html/project/app 
      /var/www/html/project/app/Config /var/www/html/project/file.txt
      drwxr-xr-x 6 root root 4096 May 30 11:01 /var/www/html/project
      drwxrwxr-x 13 root root 4096 May 29 08:09 /var/www/html/project/app
      drwxrwxr-x 3 root root 4096 May 30 05:29 /var/www/html/project/app/Config
      -rw-r--r-- 1 root root 3401 May 30 11:13 /var/www/html/project/file.txt









      share|improve this question

















      Currently, my directory's structure looks like this:



      - project
      - app
      - Config
      - file1.php
      - file.txt


      This project folder is in /var/www/html folder. I am including file.txt in file1.php using the following code.



      require_once '../../file.txt';


      The Problem is, it can't find the file even when it is there. This is working on my local system which has Ubuntu 18.04, but not on the server that has Ubuntu 19.04. The project is built using the CakePHP framework.



      $ ls -ld /var/www/html/project /var/www/html/project/app 
      /var/www/html/project/app/Config /var/www/html/project/file.txt
      drwxr-xr-x 6 root root 4096 May 30 11:01 /var/www/html/project
      drwxrwxr-x 13 root root 4096 May 29 08:09 /var/www/html/project/app
      drwxrwxr-x 3 root root 4096 May 30 05:29 /var/www/html/project/app/Config
      -rw-r--r-- 1 root root 3401 May 30 11:13 /var/www/html/project/file.txt






      permissions apache2 php






      share|improve this question
















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 30 at 12:25









      Yufenyuy Veyeh Dider

      1,7105 gold badges11 silver badges25 bronze badges




      1,7105 gold badges11 silver badges25 bronze badges










      asked May 30 at 12:09









      A JA J

      1192 gold badges2 silver badges9 bronze badges




      1192 gold badges2 silver badges9 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          3


















          It appears to me to be a difference in php's current working directory. The working system has .../project/app/Config as the current directory while the broken system has .../project as the current directory.



          One workaround would be to determine the file1.php's current directory and then refer to file.txt with a relative path from there. If I use this in file1.php, it correctly includes file.txt:



          require_once(dirname(__FILE__).'/../../file.txt');





          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147401%2fnot-able-to-find-a-file-residing-two-directories-up%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown


























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3


















            It appears to me to be a difference in php's current working directory. The working system has .../project/app/Config as the current directory while the broken system has .../project as the current directory.



            One workaround would be to determine the file1.php's current directory and then refer to file.txt with a relative path from there. If I use this in file1.php, it correctly includes file.txt:



            require_once(dirname(__FILE__).'/../../file.txt');





            share|improve this answer






























              3


















              It appears to me to be a difference in php's current working directory. The working system has .../project/app/Config as the current directory while the broken system has .../project as the current directory.



              One workaround would be to determine the file1.php's current directory and then refer to file.txt with a relative path from there. If I use this in file1.php, it correctly includes file.txt:



              require_once(dirname(__FILE__).'/../../file.txt');





              share|improve this answer




























                3














                3










                3









                It appears to me to be a difference in php's current working directory. The working system has .../project/app/Config as the current directory while the broken system has .../project as the current directory.



                One workaround would be to determine the file1.php's current directory and then refer to file.txt with a relative path from there. If I use this in file1.php, it correctly includes file.txt:



                require_once(dirname(__FILE__).'/../../file.txt');





                share|improve this answer














                It appears to me to be a difference in php's current working directory. The working system has .../project/app/Config as the current directory while the broken system has .../project as the current directory.



                One workaround would be to determine the file1.php's current directory and then refer to file.txt with a relative path from there. If I use this in file1.php, it correctly includes file.txt:



                require_once(dirname(__FILE__).'/../../file.txt');






                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered May 30 at 12:58









                Jeff SchallerJeff Schaller

                1487 bronze badges




                1487 bronze badges































                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147401%2fnot-able-to-find-a-file-residing-two-directories-up%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown









                    Popular posts from this blog

                    Tamil (spriik) Luke uk diar | Nawigatjuun

                    Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                    Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?