templates_c odd filenames

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

I also found this:

http://phpinsider.com/smarty-forum/viewtopic.php?t=9853

Could the correct files end up being in the temp folder of the Windows folder?
alby

Re: templates_c odd filenames

Post by alby »

cb2004 wrote: I also found this:
I would say that this confirms the problem of tempnam and not a bug of CMSMS as I had written
Check permissions rw of www_user in this folder

Alby
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

Which of my posts are you referring to alby?
alby

Re: templates_c odd filenames

Post by alby »

cb2004 wrote: Which of my posts are you referring to alby?
both but the first says to check permissions

Alby
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

I am stumped as to what to do. I dont think it is a permissions problem at all. Using the files from templates_c on another install I am getting green ticks on all items for the 2nd page of the install script.
alby

Re: templates_c odd filenames

Post by alby »

cb2004 wrote: I am stumped as to what to do. I dont think it is a permissions problem at all. Using the files from templates_c on another install I am getting green ticks on all items for the 2nd page of the install script.
From lib/smarty/internals/core.write_file.php
$_tmp_file = tempnam($_dirname, 'wrt');

    if (!($fd = @fopen($_tmp_file, 'wb'))) {
        $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
        if (!($fd = @fopen($_tmp_file, 'wb'))) {
            $smarty->trigger_error("problem writing temporary file '$_tmp_file'");
            return false;
        }
    }

    fwrite($fd, $params['contents']);
    fclose($fd);


echo "-------------------------------------\n";
echo "_tmp_file: ". $_tmp_file ."\n";
echo "filename: ". $params['filename'] ."\n";
echo "-------------------------------------\n";


    if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) {
        // On platforms and filesystems that cannot overwrite with rename()
        // delete the file before renaming it -- because windows always suffers
        // this, it is short-circuited to avoid the initial rename() attempt
        @unlink($params['filename']);
        @rename($_tmp_file, $params['filename']);
    }
In your case maybe tempnam don't work and smarty use the workaround that you see in smarty forum
After try to rename $_tmp_file in $params['filename']
Add red code and look in installer if you have a $_tmp_file or $params['filename']
But, repeat, it is not a bug of CMSMS but, maybe, a problem of smarty

Alby
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

Hi Alby.

Apologies but I am not really sure what you mean. The only bit I understood was try the Smarty workaround. I tried that but no joy at all.

What are you suggesting after that?

Sorry I do not understand and thanks for your continued help.
alby

Re: templates_c odd filenames

Post by alby »

cb2004 wrote: What are you suggesting after that?
If you want to know where is the point that creates problems, you must add the red code in that file and watch which of the two filenames that appear (_tmp_file:  or  filename:) are those that you see after in templates_c folder

Alby
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

Ok. _tmp_file is the correct file that is being created.
alby

Re: templates_c odd filenames

Post by alby »

cb2004 wrote: Ok. _tmp_file is the correct file that is being created.
You have problem with:
@rename($_tmp_file, $params['filename']);

drop this character and look what say the error:
        // this, it is short-circuited to avoid the initial rename() attempt
        @unlink($params['filename']);
        @rename($_tmp_file, $params['filename']);
Alby
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

Warning: rename(MYSERVER\tmp\templates_c\wrt411.tmp,MYSERVER\tmp\templates_c\%%C4^C43^C43F3191%%installer_start.tpl.php): Permission denied in MYSERVER\lib\smarty\internals\core.write_file.php on line 45
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: templates_c odd filenames

Post by cb2004 »

Alby, thanks to you I got my head round this. Permission was denied as the modify permission was not given to the folders that you would have to chmod 777 on a Unix server. Maybe a check on install is needed. If a Windows server is used you should check that the modify permission is granted.

Just trying to install but I cant as the dev server is down and it is looking for the latest version file.

Many thanks.
Locked

Return to “[locked] Installation, Setup and Upgrade”