My host upgraded my server this weekend from Apache 2.2.8 to 2.2.9 and from PHP 5.2.5 to 5.2.6.
FeedX had been working fine before this, but now throws off a parse error:
PHP error debug
Error: fopen(mydomain/assets/cache/feedx/url_89a70593) [function.fopen]: failed to open stream: Permission denied
Error type/ Nr.: Warning - 2
File: mydomain/assets/snippets/FeedX/classes/feedx.class.inc.php
Line: 300
Line 300 source: $fh = fopen($file, ’w+’);
Has anyone successfully run FeedX with Apache 2.2.9 and/or PHP 5.2.6?
Any clues on how to fix FeedX for the newest environment?
-
MODX Staff
- 10,725 Posts
That is simply a permissions problem, as the error describes. The admins may have reset default permissions on your files during the upgrade. Is this FeedX instance pointing to an XML file on your local server?
-
☆ A M B ☆
- 24,524 Posts
Here is a bit of code that works around that; I would imagine this would work for feeds as well.
http://codex.gallery2.org/Gallery2:How_To_Use_The_External_Image_Block_When_url_fopen_Is_Disabled
The problem is not in allowing url fopen as such, it’s with dumb users programming dumb stuff (as is so often the case, no?)
The usual problem with allowing URLs in fopen and in "include" or "require"
is that users do some stupid stuff like include($_GET['script'].'.php') and
get a myriad of remote code executed on your server (usually used by
spammers to send email using your server).
This was a discussion on the problem of users coding with url fopen in such a way as to create an infinite loop, eventually overloading and crashing the entire server.
http://marc.info/?t=119619812400005&r=1&w=2
This source reccomends suhosin, which can be configured on a domain-by-domain basis.
http://www.hardened-php.net/suhosin/
There are some other solutions in the user comments here:
http://www.php.net/manual/en/function.fopen.php
OK, so if I understand correctly, the simple usage of fopen in FeedX is not a security problem. Thanks for your comments, Susan.