phpsimplepie

simplepie error on xampp


I am using Simplepie on XAMPP.

I get the following error.

Severity: User Warning Message: C:\xampp\htdocs\Myapp/system/cache/simplepie/ is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. Filename: libraries/Simplepie.php Line Number: 2040

Since it is xampp it does not matter if it is writable or not, because it is always writable on xampp.

But I think C:\xampp\htdocs\Myapp/system/cache/simplepie/ is the problem.

I don't have any problem with Ubuntu though, and I wish to continue using Xampp.


Solution

  • I encountered the same problem on simplepie on PHP5 ON WINDOWS and fixed it as follows:

    1) First thing's first. You must make sure that the path exists and it is writeable:

    file_put_contents('C:\\xampp\\htdocs\\Myapp\\system\\cache\\simplepie\\', 'test');
    

    2) If this works then you can just go ahead the edit the simplepie.inc file. Make a backup of that file first. Now locate the line that says:

    if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location))
    

    Comment out the && is_writeable($this->location) portion like this:

    if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) /*&& is_writeable($this->location)*/)