I ran a test.
I made a special ram folder for my website. I managed to update the document root indirectly in the apache config to reflect that.
Suppose my folder and file structure is this:
In /myweb/public is index.php, the public file.
In /myweb/include is test.txt, a testing text file.
For every file and folder (include /myweb itself), I used the exact same linux group and user names for the domain. For permissions, I used 755.
Index contains this:
For good measure, I executed the script from the commandline (SSH) as follows:
And I got the expected results, the contents of test.txt.
However, if I run it from a remote web browser, I get nothing, and my error log claims that the file /myweb/include/test.txt does not exist even though it does.
I also ensured open_basedir is disabled and I'm using PHP 8.0.
How can I fix this? Any fast answer is appreciated.
I made a special ram folder for my website. I managed to update the document root indirectly in the apache config to reflect that.
Suppose my folder and file structure is this:
In /myweb/public is index.php, the public file.
In /myweb/include is test.txt, a testing text file.
For every file and folder (include /myweb itself), I used the exact same linux group and user names for the domain. For permissions, I used 755.
Index contains this:
Code:
<?php
echo file_get_contents("/myweb/include/test.txt");
?>
For good measure, I executed the script from the commandline (SSH) as follows:
Code:
cd /myweb/public
php index.php
And I got the expected results, the contents of test.txt.
However, if I run it from a remote web browser, I get nothing, and my error log claims that the file /myweb/include/test.txt does not exist even though it does.
I also ensured open_basedir is disabled and I'm using PHP 8.0.
How can I fix this? Any fast answer is appreciated.