-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
**SOLVED** >1.7.34 - admin file_get_contents() permission denied error - windows and php 8.18 and below #2299
Comments
Seems to be a composer cache issue, not limited to grav but seen with laravel seems to be composer getting a bit greedy on memory bit drastic having to set the php memory limit to -1 , but will try and increase and see in php and see if I can find a happy number |
So did a fresh php , enable extensions , downloaded and placed the latest symfonycli and then a fresh clean copy of grav, brought up login / account creation page, on submit the error occurred So its something a little bit more deeper that I first thought.
Noticed this above
I dont have Ip6 enabled would this cause an issue |
I'm also experiencing this frequently on my localhost since the last Grav/admin upgrade (though don't know that it's related): |
Glad to hear its not just me then lol. Yep seems to started with a 1.7.34 .. but with saying you are running running php 7.4 looks like either a particular php setting or the admin plugin / grav core. But with my setting up a fresh copy of php and grav and the symfony-cli with nothing clever set, just the required parameters, but it does happen over and over again when performing update of pages, admin login, all resolved by a F5 on the browser .. but slightly annoying lol |
I'm also experiencing this error while trying to save a change made in Admin after updating Grav to v1.7.34 and Admin v1.10.34 on PHP 8.0.20. |
jus to confirm are all you guys on windows ??? |
Yes, I'm on Windows 10 Pro build 19044. |
Yep on windows and also have a linux / ubuntu machine. I thought I might have solved it due to seeing an old post by matias in a gantry conversation, Will try again, with a clean install. For me this problem only occurred from the last 1.7.34 update. I have gone back to using 1.7.33 in the meantime , just to keep going and let my brain have a think what could be wrong. Yep windows is the version that is causing me grief . Ran as small portable configuration with a cmd file , and fresh php install. I did notice that on ubuntu when I set it up, the php.ini automatically has But it seems a permission issue or reading a file as a directory or vice versa. Video of the error being invoked by simply change the template from the advanced / admin panel Thank Andy *tested with Increased the memory of PHP to -1 and recorded this little vid, showing the error in action |
Further to a lot more reading and experimenting I have now concluded this is not a grav admin issue, its more of grav core compatibility issue I have tested the following combinations Grav 1.7.33 on PHP 8.1 and 7.4 , works no issue Grav 1.7.33 with the 1.7.34 compatible plugin updates on n PHP 8.1 and 7.4 , works no issue Grav 1.7.34 full on PHP 7.3.9 X86 and X64 - NO ISSUES So a compatibly issues with PHP 7.4 OR 8.1 x86 / x64 So @nvandelden and @yankl try dropping to php 7.3.9 and let us know on here, if that resolves the issue @rhukster - I hope this gives you some sort of clue . Thank you Not sure if you want me to cross post this issue in to the grav core folder |
Dam it.. its does break something tho , Keep getting red messages , regarding the dash board, and notifications etc , but too tired to look at this any further, at least it doesn't break with an an exception error. Or go back to Grav 1.7.33
This is something that has reported and been solved but that was in a forward direction, rather this backwards step of downgrading php (Ajax Error - Invalid Ajax Response) and https errors, But a quick fix was to set reverse proxy look up to enabled in the system.yaml Not telling you how to sucks eggs. but this is a useful resource for a quick virtual box for ie / edge testing, in various flavours |
I can gladly confirm this was nothing at all to do with GRAV and GRAV-ADMIN or windows permissions. This fault is caused by PHP 8.1.x until PHP 8.1.9 was released on the 04/08/22. I have now tested GRAV 1.7.34 and 1.7.35 with PHP releases >8.x and 8.1.8 - and the error occurs. After further research other PHP based system had been reporting a similar error which did point to a PHP incompatibility / bug , as this is a standard procedure call and seemed to limited to Windows Only Systems) With the release of php 8.1.9 (4 Aug 22) A fix seem to finally resolved this issue on Windows systems (this has taken a long time to be confirmed fixed and implemented) SOLUTIONInstall / Upgrade your PHP to 8.1.9 minimum for PHP 8.x compatibility with Grav Tested over a couple of days on a fresh install of Grav 1.7.35 and PHP 8.1.9. **WORKING - NO ERROR ** Further reverse testing to find / prove where this bug / issue has come from and can be reproduced. |
@spamhater-grav I tried your solution and upgraded today to PHP 8.1.9. However, I still got the error. It was on Grav v1.7.35 but not a fresh install. |
@yankl , I have had it once today, but this was my mucking about with my testing stuff, and I think you might get it to occur on an existing install due to cache issue, as on a old 1.7.34 site I hadn't clear the cache on that grav session completely. It appeared once, at login, but since then clearing cache and temps files (windows / php / grav) clearing them all , from top to bottom, it hasn't occurred since, so maybe the key is the fresh install . So it was due to me chopping and changing and testing different gravs, and under different php's. Delete all the contents of Suggestion , make a new grav 1.7.35 directory, set it up / admin-ize it , and view site, view admin ... etc and test clean, then just move your existing user directory across to the new install and try like that. :) |
This is DEFINITELY a windows PHP 8.1 issue. It's not a Grav issue because we're just using core PHP functions, nothing has changed on our side, and it works fine in other platforms and versions of PHP. Feel free to keep this open to track things, but there's nothing we can do on our side. |
Yep... deffo @rhukster I am just saying what the test environment was when this was irradiated, its taken them (PHP) about 6 months to sort (windows.php.net that is) they refer to a problem with file locking in their fix. :) and other php platforms have had the same issue . As soon as I can close it I will do, as I know that since the release of the update 4 days ago (PHP that is - even tho it was coincident that Grav 1.7.35 was released on the same day.. it resolved it straight away) |
@spamhater-grav I appreciate very much your investigations! I thought of clearing the cache right after writing my last message, and then did so. Hopefully that will have solved it. You can probably reclose the issue, as there's nothing to be done on Grav to solve it.. just wanted to keep track here in case anyone is watching and can be helped. If I keep getting it for a while I'll renotify. Thanks again! |
Good to hear. We can lay this one to bed :) THIS IS NOT A GRAV ISSUE - THIS IS A PHP ISSUE. Grav dev team thanks for the support and the clarity :) IF YOU ARE READING THIS
PROBLEM SOLVED :) |
Please open, it's not clear. |
I would also be happy if this thread is reopened and the "SOLVED" is questioned. I have the same annoying problem with Grav 1.7.35 on PHP 7.4.14 (Xampp on Win 10). I have posted details in the Grav forum. |
I agree. Upgrading PHP did not solve it for me. However I only see this error on Windows. |
Yes, I have server ubuntu with Grav 1.7.35 (latest), once show, just chown/ chmod is clear, but in dev stage (windows 10) ... it's sometimes show, i'm clear cache and refresh it's oke, sometimes show again. and... not problem what's your php version. Thanks @CunoVoll , i follow grav forum too. |
Hi all, I have reopened this to try and get it resolved for people personal issues. I will try and help you as much as I can, I will also replicate your setup as portable version, but without a Apache Stack at first, to test and see why you are running in to the issue. The error does not happy on other platform hence the WINDOWS in the title , as I couldn't create the same issue under Ubuntu. The error went away with a clean build, or ensure a total clear cache (as if existing cache is there, it does tend to appear once or twice, but then goes away) . So fire away, I am going to set up a portable Grav and PHP in my github, where you can just download a run from a directory. (in progress) First test is to ensure it runs, then 2nd test is to copy your existing user directory across. I am not the greatest github user, so bare with me whilst a get this setup and test a releasable version. This version wont interfere with your running stack, as it will be self contained, |
I can confirm that this issue still exists on windows with Grav 1.7.35, Admin 1.10.35 and PHP 8.1.10. All cache was cleared. |
Still not working with Grav 1.7.36, Admin 1.10.36. Older version of Grav and Admin do work properly. So I don't think it is okay to say it's only a bug in PHP on windows. This bug was clearly introduced by a Grav update. |
The issue is on this commit getgrav/grav@6fa96ca |
For those who use Windows local
|
I just made your tests and you seem to be on the right track. Already after disabling the plugin option, there is no more file_get_contents() permission error message. Although the message «Fetch Failed NetworkError» still appears, even when I deactivated the Flex-Objects-Plugin, everything works as usual like before. Thank you for your solution. |
disable "Flex-ojects" its' work. |
We must waiting for update minor fixed? |
Still those on Windows with the "Flex Objects" plugin.
|
I also notice a clear difference, but not that big. For quite some time now, I generally find that the loading speed within the admin has become very very slow compared to how it was before. |
disabling flex objects isnt an option for many people and you lose a lot of features |
This is hopefully only a temporary solution until the real error is found. But I think this solution proves that the culprit is not the PHP version. By the way, I got this annoying permission-error message even with the latest PHP version 8.1.10. |
It is when the site is in development on windows, in production Grav works very well with Flex Objects
👍 |
the error has already been found on the commit, its a basically, windows doesnt allow to access the file (to read its contents) while teh file is locked. If you comment the lines of the commit i posted above, it will fix the issue, however it may cause an issue where if many saves at once, it doesnt have the proper latest changes non cached |
i mean is theres lots of people developing and using flex objects in development, its easier to comment those lines since ur not gonna get mass saves in local dev |
I just upgraded to PHP 8.1.10 and the error still persists. So this is definetely not fixed. |
I've committed a temp fix in Grav develop branch that skips this code on windows: Please test. |
Failed to create copy: Validasi gagal:
Input tidak valid di "Template Halaman" |
Can confirm that release 1.7.37 solved the issue unter Windows. But strangely the index.php was missing after update and needed to be restored manually. |
I had the same issue with the missing index.php on my local Windows machine! But I had it last time I updated as well (v1.7.36). For some reason, didn't think to open an issue then. |
I can confirm it solved the issue. |
I tested it today and everything works fine again. Many Thanks. |
really? fresh install or update? i'm not luck. now, can't save the page file of .md |
I update Grav to v1.7.37.1 and it worked. On somer older installations update was only possible with PHP 7.4 or even 7.3. To change the PHP-Version is quite easy since I switched from XAMPP to Laragon. |
This can be finally closed, as in addition Andy has added a patch from mdestafadilah in to the build and no one has had issue since . This can finally be closed and gone to bed. Thanks for all the input. ! |
More for informative reasons, as need to test and truly replicate but finding this error has occurred (PHP 8.1.7 and fresh grav 1.7.34)
When the user login in to admin on a localhost test server (running php , not a web server)
Presume there is a little cache issue , when logging in to admin , I get the above error after accepting login and trying to display the dashboard, simply resolved by pressing the F5 key to refresh the browser window.
The text was updated successfully, but these errors were encountered: