News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Cache not writable error

Started by MultiformeIngegno, September 20, 2009, 06:00:07 AM

Previous topic - Next topic

MultiformeIngegno

Hello, I've the same problem: http://dev.simplemachines.org/mantis/view.php?id=3747

I see it's solved, can you provide me a temporary patch instead of waiting for the new rc2 release?
Thanks in advance! :)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Norv

Is it a problem if you simply make sure that the cache directory (from the SMF directory) is writable?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

MultiformeIngegno

The problem is that it IS writable.
And with the forum I don't have any problem, I receive this error only in a SSI.php-integrated page...

I tried to write var_dump($cachedir); and the directory is right, so, don't know why....
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

H

Is the cache AND the files inside definitely chmod 777?
What is the code you're using on the page where you are getting the error? :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

MultiformeIngegno

Quote from: H on September 20, 2009, 10:01:59 AM
Is the cache AND the files inside definitely chmod 777?
What is the code you're using on the page where you are getting the error? :)
Yes, also the files within the dir..
I've attached the file (a MediaWiki implementation).
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

H

Does the problem occur with a php page that just has an SSI include? I wonder if there is a variable conflicting or something
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

MultiformeIngegno

Quote from: H on September 20, 2009, 02:01:08 PM
Does the problem occur with a php page that just has an SSI include? I wonder if there is a variable conflicting or something
I have other SSI.php-integrated pages in the same website and they don't have this problem... If you want links, the page with problems is wiki.rockciclopedia.com (the file I've attached in the above post), the others (with ssi.php too) are faq.rockciclopedia.com and toolbar.rockciclopedia.com, they work properly..
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

It may be limited to this site.

Are you running this on a shared server?

MultiformeIngegno

Yes, shared server (linux)...
I've access to ftp, databases, shell access, subdomains, but not php.ini....
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Can you provide a phpinfo() file output? (What is a phpinfo() file?)

I'm wondering if there is an issue with open_basedir

MultiformeIngegno

RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Can I have one from the wiki subdomain too please?

MultiformeIngegno

RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Hmm, no that isn't it.

Does the wiki run as a different user on the server?

MultiformeIngegno

#14
Quote from: Arantor on September 20, 2009, 05:39:03 PM
Hmm, no that isn't it.

Does the wiki run as a different user on the server?
No, same ftp user....
Also db user is the same...

Anyway I don't see any slowdown compared to the forum... So, it's a "fake" advice..? :-\
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

No, it's not fake advice. It's just that as the forum gets bigger it will want to save things in the cache, which means things will be faster than regenerating them every time. This is weird though.

MultiformeIngegno

Quote from: Arantor on September 20, 2009, 05:49:38 PM
No, it's not fake advice. It's just that as the forum gets bigger it will want to save things in the cache, which means things will be faster than regenerating them every time. This is weird though.
Pheraps it's a conflict with the built-in cache system of MediaWiki...
To update the cache in MW you need to put a &action=purge after the page URL....

They can't work together...?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

I don't think combining the two does work all that well; but it does depend a lot on what you're trying to do. There aren't that much in the way of bridges, for example. MediaWiki is a huge application and very complex - just inserting SSI.php isn't going to be as successful as it might otherwise.

MultiformeIngegno

#18
Quote from: Arantor on September 20, 2009, 06:00:47 PM
[...] but it does depend a lot on what you're trying to do. [...]
Well... I'll try to explain... Please help me if you can, that are weeks I'm trying to solve this... anyway...
I need to have the same look and feel for the wiki, I discarded the chance of creating a similar forum skin for mediawiki, first 'cause it's too difficult for me, then 'cause if I change themes on forum or other it could be difficult to change also the wiki skin times to times...

So I opted for the SSI.php ('cause I used it other times).
I've tried 2 different ways..

First one (the same file I've attached some posts above):

require_once('SSI.php');
template_header();

// the rest of the page here


It works without a hitch, the only problem is that I CAN'T SPECIFY A CONTEXT! It has no effect...
In the other SSI.php pages I used, instead of template_header(), the template_main(), then I specified a context with this code (and worked!):
$_GET['action'] = 'mypage';
$context['mypage'] = true;


...but if I try to add this to the file with template_header() it doesn't work!
It works only if instead of template_header() I put template_main(), but this, to work, has to be written in this way:


function template_main()
{
   echo '

ALL_THE_PHP_FILE

';
}


...but with this code I receive a lot of syntax errors (here's the file)... I tried fixing all of them, so I've put a \ before all apostrophes and so on, but I continue getting some errors I'm not able to solve...

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /MonoBook2.php on line 26

Parse error: syntax error, unexpected T_CLASS in /MonoBook2.php on line 34

How can I do?
Is it better to use the template_header (but how can I specify a context?! I need this to specify some conditions for the wiki, an example: output a different description meta-tag or having the right active button created in Subs.php) or the template_main (but in this case I have to fix all syntax errors...)?

Sorry for my english, I hope you can understand... :(
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Well, MW skin classes are really not designed to be inter-operated with SSI, since while SMF is procedural, MW is object oriented, they are physically worlds apart in structure and design.

I'd be looking to make them look similar rather than trying to interoperate them; I'd say that they are so incompatible right down the wire it isn't even funny.

MultiformeIngegno

#20
Quote from: Arantor on September 20, 2009, 06:33:21 PM
Well, MW skin classes are really not designed to be inter-operated with SSI, since while SMF is procedural, MW is object oriented, they are physically worlds apart in structure and design.

I'd be looking to make them look similar rather than trying to interoperate them; I'd say that they are so incompatible right down the wire it isn't even funny.
Mmmh... ok, but if you see wiki.rockciclopedia.com, it's almost done... the only problem I have is that I need to specify a context (I need this to specify some conditions for the wiki, an example: output a different description meta-tag with "if (!empty($context['mypage'])) echo'blablabla'" or having the right active button created in Subs.php)..

Why this code doesn't work for template_header:
$_GET['action'] = 'mypage';
$context['mypage'] = true;

...and work instead for template_main?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

The problem is that when you get inside the files in MW, you start needing to global $context everywhere, which is probably the core reason it doesn't work.

MultiformeIngegno

Quote from: Arantor on September 20, 2009, 06:57:05 PM
The problem is that when you get inside the files in MW, you start needing to global $context everywhere, which is probably the core reason it doesn't work.
And if I use template_main fixing all syntax errors (as I'm trying to do)?
It should work 'cause I tried it echoing only "abcde 123" and it worked (also the context).! :)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

I don't think it'll work, but try it. AFAIR template_main isn't for the header area, but I could well be wrong - I'm not a specialist on the integration stuff, but after trying to theme MediaWiki once that was enough for me...

MultiformeIngegno

OK... and what do you think about these errors (they're the latest to fix, I hope!)..

1) Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/rock123/public_html/wiki/skins/MonoBook2.php on line 26

...that corrispond to the line in bold:
Quote
// Load up SSI
require_once('../forum/SSI.php');

// ...and go!
obExit(true);

// ...load the function template_main
function template_main()
{
   echo '

/**
* Inherit main code from SkinTemplate, set the CSS and template filter.
* @todo document

I've tried replacing echo ' with echo \' but the error remains....

2) Parse error: syntax error, unexpected T_CLASS in /home/rock123/public_html/wiki/skins/MonoBook2.php  on line 34

...that corrispond to:
Quote
* @ingroup Skins
*/

class SkinMonoBook extends SkinTemplate {
   /** Using monobook. */
   function initPage( OutputPage $out ) {
      parent::initPage( $out );
      $this->skinname  = \'monobook\';
      $this->stylename = \'monobook\';
I can't see the problem with that line....
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Well, if you have an unexpected class that means there is a syntax error further up the file, e.g. an untermined { } or similar.

Advertisement: