• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug acp:store templates as files option: error messagen when creating new style

Marcus

Well-known member
#1
When I create a new style with the store templates as files option activated, I get this message:

Server Error

file_put_contents(/...internal_data/templates/S.0,L.0,account.css.php): failed to open stream: Permission denied
XenForo_Application::handlePhpError()
file_put_contents() in XenForo/Template/FileHandler.php at line 95
XenForo_Template_FileHandler->_saveTemplate() in XenForo/Template/FileHandler.php at line 50
XenForo_Template_FileHandler::save() in XenForo/Model/Template.php at line 1410
XenForo_Model_Template->writeTemplateFiles() in XenForo/Option/TemplateFiles.php at line 23
XenForo_Option_TemplateFiles::verifyOption()
call_user_func_array() in XenForo/DataWriter/Option.php at line 345
XenForo_DataWriter_Option->_validateOptionValuePreSave() in XenForo/DataWriter/Option.php at line 211
XenForo_DataWriter_Option->_preSave() in XenForo/DataWriter.php at line 1414
XenForo_DataWriter->preSave() in XenForo/DataWriter.php at line 1354
XenForo_DataWriter->save() in XenForo/Model/Option.php at line 568
XenForo_Model_Option->updateOptions() in XenForo/ControllerAdmin/Option.php at line 174
XenForo_ControllerAdmin_Option->actionSave() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in ...admin.php at line 13
 
R

ragtek

Guest
#2
the template directory have no permissions

mike, kier shouldn't you throw here an error/notice so the users knows he have to set the permissions manual?

PHP:
        protected function _createTemplateDirectory()
        {
            if (!is_dir($this->_path)) {
                if (XenForo_Helper_File::createDirectory($this->_path)) {
                    return XenForo_Helper_File::makeWritableByFtpUser($this->_path);
                }
                else
                {
                    return false;
                }
            }

            return true;
        }
 

Mike

XenForo developer
Staff member
#4
mike, kier shouldn't you throw here an error/notice so the users knows he have to set the permissions manual?
You should never have to - it's a requirement that the internal_data directory itself is writable by the webserver. As such, I'm not sure why this would occur without that.

Marcus, did you move servers or anything like that recently?
 

Marcus

Well-known member
#5
Today I activated CDN by pointing both domain.net as sub.domain.com to my forum domain.com, pointed these domains directly to /internal_data and first activated sub.domain.com and since then I use domain.net.

I noticed this behavior short after. Ragtek pointed me to the directory permissions. Whenever I put permissions to 0775 it worked and when turned again to 0755 it did not work.

Now it also works with 0755.
 

Marcus

Well-known member
#6
I reproduced this bug when creating a new template in debug to a custom addon.

When creating the template I got this error message
I disabled the acp>store template as files option
I could create the new template in debug modus
I enabled the acp>store template as files option
I got this error message
I changed directory permissions to 777
It works
 

bambua

Well-known member
#7
Depending on your server settings on some servers 755 won't work for the data directories you have to use 777 for them. I know on my server the webserver runs as nobody which means for data I have to go with 777, if it's running as a user, as long as that user is the owner of the files you can go with 755.
 

Marcus

Well-known member
#8
After a PLESK update today I experienced the same problem again. I changed permissions of internal data directory to 0777 it worked. I changed them back to 0755 and it works now.
 

Marcus

Well-known member
#9
The other parts of my internal_data directory can not be written to after my Plesk Update. Now I had to 0777 all these subforums and even the sub-subforums for the attachments.