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?
If a tournament advertises G/30, can either player demand G/25 d5?
Simple code that checks if you're old enough to drive
Paint numbers from 1 to 23 with three colours
Why did the people of Zion never find evidence of the previous cycles?
Pass variable to sed and change backslash to forward slash
How can Edward Snowden be denied a jury trial?
where does black come from in CMYK color mode?
Are there any disadvantages to taking my employer's increased offer, even if I am likely to leave soon?
How could a sequence of random dates be generated, given year interval?
What's the most profitable use for an elemental transmuter?
Why was the "Cave of the Patriarchs" forbidden to Jews?
Relying on default field initialisation - is bad programming style?
NFL football incentives
How can an immortal member of the nobility be prevented from taking the throne?
The professor for one of my classes has no direction
Why does Mainland China and Taiwan require Visas for each other's citizens?
What is more proper notation in piano sheet music to denote that the left hand should be louder?
Is there a more elegant way to express ((x == a and y == b) or (x == b and y == a))?
Moisture leaking out of chip in floor tile
What does /r mean in a score?
How much caffeine would there be if I reuse tea leaves in a second brewing?
Make a haystack (with a needle)
Equivalent of phrase 'emu parade' in other English-speaking places
Custom align environment which auto breaks line before = and aligns at =
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;
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
add a comment
|
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
add a comment
|
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
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
permissions apache2 php
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
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
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');
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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');
add a comment
|
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');
add a comment
|
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');
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');
answered May 30 at 12:58
Jeff SchallerJeff Schaller
1487 bronze badges
1487 bronze badges
add a comment
|
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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