Hello guys,
I have installed Visual Studio Code. First time I tried to run/debug a project - phpBB3.
This is from debug console: "Unable to write to the cache directory path "./cache/production/". Ensure that the web server user can write to the cache folder."
Does that mean ~/.cache? or ~/usr/share? or even /var/www?
Can you tell me what folder exactly I have to set permissions or chown? I have apache, mysql on Mint 21.3
Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server user
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
-
- Level 3
- Posts: 112
- Joined: Mon Mar 27, 2023 3:33 pm
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
It's not possible to answer your question without seeing your Apache configuration. However, if you installed phpBB in
That said, when deploying a web application in Apache, it's best to do so in a separate "site" configuration which can be enabled/disabled as required. As part of that configuration you will specify the top level directory (DocumentRoot) where the application is stored. This should not be part of your home directory, nor
To protect your system, this directory should be owned (and grouped) by the user
/var/www
then it means /var/www/cache
.That said, when deploying a web application in Apache, it's best to do so in a separate "site" configuration which can be enabled/disabled as required. As part of that configuration you will specify the top level directory (DocumentRoot) where the application is stored. This should not be part of your home directory, nor
/var/www
, but somewhere else. It could be in /usr/local/share/www/phpbb
or /home/www/phpbb
for example.To protect your system, this directory should be owned (and grouped) by the user
www-data
, which is what Apache uses to access files on the system.-
- Level 3
- Posts: 112
- Joined: Mon Mar 27, 2023 3:33 pm
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
but why then the DocumentRoot directory is /var/www/html by default?
it's not clear to me if I set the directory owned by www-data ... /var/www/ to 774 I cannot read it or cd to it. But I understood no one of users should read it for savfety reasons. So how could I brows files then, because I am user, not www-data, not root. I cannot use command sudo cd www ... and it would be so bad to write in front of every command sudo...
it's not clear to me if I set the directory owned by www-data ... /var/www/ to 774 I cannot read it or cd to it. But I understood no one of users should read it for savfety reasons. So how could I brows files then, because I am user, not www-data, not root. I cannot use command sudo cd www ... and it would be so bad to write in front of every command sudo...
-
- Level 3
- Posts: 112
- Joined: Mon Mar 27, 2023 3:33 pm
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
Also regarding debuging if I set chmod 777 to www-data:www-data folder www,
then I can run the VSC debugger. I added a breakpoint to the index.php but even that no errors are present there, I don't see it running. Should I expect it to see it step by step debugging in the VSC? And there should I expect the output? Is it necessary to set Browser in config to view the results?
then I can run the VSC debugger. I added a breakpoint to the index.php but even that no errors are present there, I don't see it running. Should I expect it to see it step by step debugging in the VSC? And there should I expect the output? Is it necessary to set Browser in config to view the results?
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
This may be a complete red herring, my web development needs are limited (as are my skills). I have the live server extension installed in VScode. When I "go live", it opens my browser showing the end result. Every time I make a change and save it gets updated in my browser. It has made my life in this area a lot easier.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
-
- Level 3
- Posts: 112
- Joined: Mon Mar 27, 2023 3:33 pm
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
I have the live server install and enabled. I check it again and they have some help there. I see there should be same bar with icons to run the live server. I can use hotkey alt+l, alt+o to start the live server. Vivaldi opened on server location in folder of phpBB3, then I click on index.php and I got dialog window to download the file. This doen't look like it is connected to apache. Maybe it uses incorrect port? OK, I got it. Live Server is for static websites only. Not for php.
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
Well I have learnt something.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Visual Studio Coder - Unable to write to the cache directory path "./cache/production/". Ensure that the web server
It's where you would put your static pages.barhaqodes wrote: ⤴Tue Mar 26, 2024 3:41 pm but why then the DocumentRoot directory is /var/www/html by default?
Of course, if you want to, you can put your phpBB in there, it's just not the best practice for a live site accessible to the world. Consider a website that has some static information, it runs a CMS, a forum, a photo gallery. These things should be in separate "sites" so that they can be enabled/disabled as necessary without affecting the rest of the website.
Or, perhaps you are testing phpBB this month, and later on you're going to move onto test another forum application. Again, separate sites are better for this.
If you are only ever going to have this instance of phpBB and nothing else, then by all means use
/var/www/html
.Set all files to be owned by you, grouped by www-data, then mode 750 for all directories, 640 for all files. Then set mode 770/660 for directories/files that www-data needs to write to.barhaqodes wrote: ⤴Tue Mar 26, 2024 3:41 pm it's not clear to me if I set the directory owned by www-data ... /var/www/ to 774 I cannot read it or cd to it. But I understood no one of users should read it for savfety reasons. So how could I brows files then, because I am user, not www-data, not root. I cannot use command sudo cd www ... and it would be so bad to write in front of every command sudo...
It's Apache that's running the web application not VSC, so you'll need to setup remote (process) debugging. For php that requires something like Xdebug, but I've never used it so can't help further.barhaqodes wrote: ⤴Tue Mar 26, 2024 3:44 pm then I can run the VSC debugger. I added a breakpoint to the index.php but even that no errors are present there, I don't see it running. Should I expect it to see it step by step debugging in the VSC?