php joomla 安装新语言 DateTime::__construct(): 无法解析时间字符串 (jerror)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16632546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
joomla installing new language DateTime::__construct(): Failed to parse time string (jerror)
提问by jeffery_the_wind
I am a fresh installation of Joomla 3.1 running on my home computer. My environment is Ubuntu 12.10 with apache server, php 5.4.6 installed. Since installing the system, no I am just trying to install more languages through the language manager:
我是在家用电脑上全新安装的 Joomla 3.1。我的环境是带有 apache 服务器的 Ubuntu 12.10,安装了 php 5.4.6。自从安装系统以来,不,我只是想通过语言管理器安装更多语言:
As you can see, the 2 additional languages that I wanted show up in the list, but after selecting each language, and clicking "Install", I was led to a page with this message:
如您所见,我想要的另外 2 种语言显示在列表中,但是在选择每种语言并单击“安装”后,我被引导到一个包含此消息的页面:
DateTime::__construct(): Failed to parse time string (jerror) at position 0 (j): The timezone could not be found in the database
DateTime::__construct(): 无法解析位置 0 (j) 的时间字符串 (jerror): 在数据库中找不到时区
With a button to just go back to the control panel. I was suprised to see these languages show up in the list.
只需一个按钮即可返回控制面板。我很惊讶地看到这些语言出现在列表中。
I also saw this message when I tried (and failed) to install my first component - it was a component to embed google maps in articles.
当我尝试(但失败)安装我的第一个组件时,我也看到了这条消息——它是一个在文章中嵌入谷歌地图的组件。
Anyway, I haven't been able to find a solution for this problem online, I was wondering if anyone out there knows what the problem is. Any help is greatly appreciated!
无论如何,我一直无法在网上找到解决此问题的方法,我想知道是否有人知道问题是什么。任何帮助是极大的赞赏!
Thanks!
谢谢!
EDIT
编辑
The problem in my case turned out to be that some on my directories where un-writable. I went to the "directory permissions" tab under "System Information", and tried to make sure that all the directories were writable. When i first opened it, all the directories in the "administrator" directory were not writable, and we changed them to be writable through the shell in linux, then i was able to install the new languages without the error message above.
在我的情况下,问题原来是我的目录中的一些不可写。我转到“系统信息”下的“目录权限”选项卡,并尝试确保所有目录都是可写的。当我第一次打开它时,“administrator”目录中的所有目录都是不可写的,我们通过linux中的shell将它们更改为可写,然后我就能够安装新语言而没有上述错误消息。
回答by Ahmad Alfy
This is the most stupid bug in Joomla 3. I wasted 2 days trying to solve this out and I found that the problem was that the logand tmppaths were not set correctly on the configuration.php
这是 Joomla 3 中最愚蠢的错误。我浪费了 2 天试图解决这个问题,我发现问题是在configuration.php上没有正确设置日志和tmp路径
Don't worry there's nothing wrong with your Date/Time/Timezone/Localization settings. It's just a stupid silly message that doesn't relate to the actual problem.
不要担心您的日期/时间/时区/本地化设置没有任何问题。这只是一个愚蠢的愚蠢信息,与实际问题无关。
To save your time I recommend you get the full path using this script:
为了节省您的时间,我建议您使用以下脚本获取完整路径:
<?php
$dir = dirname(__FILE__);
echo "<p>Full path to this dir: " . $dir . "</p>";
?>
Create a PHP file and upload it to Joomla root. It will get you the path correctly
创建一个 PHP 文件并将其上传到 Joomla 根目录。它将为您提供正确的路径
My path looked exactly the same except that there was an uppercaseletter screwing everything up.
我的路径看起来完全一样,只是有一个大写字母把一切都搞砸了。
Note that this error could happen if the folders doesn't have the correct permission (not writable)
请注意,如果文件夹没有正确的权限(不可写),则可能会发生此错误
回答by Eashan
I have a successful answer for this problem in joomla 3x
我在 joomla 3x 中成功解决了这个问题
DateTime::__construct(): Failed to parse time string (jerror) at position 0 (j): The timezone could not be found in the database
DateTime::__construct(): 无法解析位置 0 (j) 的时间字符串 (jerror): 在数据库中找不到时区
Set the correct path to your joomla site tmp folder
Log in to joomla administrator Panal System -> global Configuration -> Server
and give the correct path ("Path To Tmp Folder")
Path to Sloving PHP file
libraries/joomla/filesystem/folder.php
Change Online 260 with this code
设置 joomla 站点 tmp 文件夹的正确路径
登录joomla管理员Panal系统->全局配置->服务器
并给出正确的路径(“Tmp 文件夹的路径”)
Sloving PHP 文件的路径
图书馆/joomla/filesystem/folder.php
使用此代码更改 Online 260
__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY'). 'Path: ' . $path, JLog::WARNING, 'jerror'
__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY'). 'Path: ' . $path, JLog::WARNING, 'jerror'
回答by user2221845
I was able to fix this by creating /tmp and /log directories one level above the website root and making them writable.
我能够通过在网站根目录上方创建 /tmp 和 /log 目录并使它们可写来解决此问题。
Example:
/home/sitename/log
/home/sitename/tmp
回答by Red Dog
Ok just had the same problem, was helping a friend who couldnt get his new joomla 3 site to install a new template. Every thing looked good in system infomation, all writeable but on looking further I found although plugins/ was marked as writeable I had to change all the permissions for each folder in plugins/ and it worked straight away. Hope this helps.
好吧,刚刚遇到了同样的问题,正在帮助一个无法让他的新 joomla 3 站点安装新模板的朋友。系统信息中的每件事看起来都不错,都是可写的,但进一步查看时,我发现虽然 plugins/ 被标记为可写,但我必须更改 plugins/ 中每个文件夹的所有权限,并且它立即起作用。希望这可以帮助。
回答by Hoang Pham
This issue can be fixed easily.
这个问题很容易解决。
go to plugins/system/yt/includes/libs/yt-minify.php
转到 plugins/system/yt/includes/libs/yt-minify.php
go to this line :
转到这一行:
$this->optimizeFolder = $app->getTemplate(true)->params->get('optimizeFolder', 'yt-assets');
and change it to :
并将其更改为:
$this->optimizeFolder = $app->getTemplate(true)->params->get('optimizeFolder', 'yt-assets');
$this->optimizeFolder = JPATH_ROOT.'/'.$this->optimizeFolder;
hope it works!
希望它有效!
回答by bombcar
If you are using Admin Toolsit can cause this to appear when you use the wrong password when trying to login as admin (because it locks directories). Also, it'll give you a heart attack.
如果您使用的是管理工具,当您尝试以管理员身份登录时使用错误的密码(因为它会锁定目录)会导致出现此问题。此外,它会让你心脏病发作。
回答by Hamid Saeedian
this problem cause of changing the host of your joomla and the address of /tmp and /log directory in configuration.php file need correction with new address
这个问题的原因是改变了你的joomla的主机和configuration.php文件中的/tmp和/log目录的地址需要用新地址更正