我在ExpressionEngine v2.5.3安装上遇到了一个问题,即我认为高内存使用率.这是最近的EE1 - EE2升级,如果它有所作为.
此项目上的空模板使用10MB内存.我测试了另一个v2.5.3项目和一个空页面,使用2MB内存.我在普通模板上看到30 + MB的使用率,并且浏览器经常失去与服务器的连接.
是一个插件导致内存使用增加?追踪这种情况的最佳方法是什么?
升级后,安装肯定会起作用.
模板调试
(0.000011 / 9.01MB) - Begin Template Processing -
(0.000172 / 9.01MB) URI: test
(0.000185 / 9.01MB) Path.php Template: /
(0.000199 / 9.01MB) Retrieving Template
(0.000210 / 9.01MB) Parsing Template URI
(0.002112 / 9.02MB) Template Group Found: test
(0.002166 / 9.02MB) Retrieving Template from Database: test/index
(0.003599 / 9.02MB) Template Found
(0.003690 / 9.02MB) Template Type: webpage
(0.003711 / 9.02MB) Parsing Site Variables
(0.003767 / 9.02MB) Snippets (Keys): structure:is:page|structure:is:listing|structure:is:listing:parent|structure:page:entry_id|structure:page:template_id|structure:page:title|structure:page:slug|structure:page:uri|structure:page:url|structure:page:channel|structure:page:channel_short_name|structure:parent:entry_id|structure:parent:title|structure:parent:slug|structure:parent:uri|structure:parent:url|structure:parent:child_ids|structure:parent:channel|structure:parent:channel_short_name|structure:top:entry_id|structure:top:title|structure:top:slug|structure:top:uri|structure:top:url|structure:child_listing:channel_id|structure:child_listing:short_name|structure:freebie:entry_id|structure:child_ids|structure:sibling_ids|structure_1|structure_2|structure_3|structure_4|structure_5|structure_6|structure_7|structure_8|structure_9|structure_10|structure_last_segment|site_id|site_label|site_short_name|last_segment
(0.003784 / …Run Code Online (Sandbox Code Playgroud) 我一直在尝试增加MAMP(Mac OSX)中的php memory_limit.我使用的PHP版本是5.4.1.0.我已经阅读了有关为MAMP Pro创建新模板的信息,但我正在使用标准版本的MAMP.
我已经尝试了以下所有内容,但似乎没有任何效果.任何帮助将非常感激.
感谢您的时间.
php_value memory_limit 128M
Run Code Online (Sandbox Code Playgroud)
我在以下文件中将以下内容从32M更改为128M:
/Applications/MAMP/conf/php5.4.10
memory_limit = 128M ;
然后我完全退出MAMP并重新启动它,但在MAMP phpInfo中它仍然显示:
memory_limit 32M
虚拟主机
我正在使用虚拟主机来设置我自己的URL.我在某处读到可能需要增加内存限制.所以我把它添加到'php_value memory_limit 128M':
/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /Applications/MAMP/htdocs
ServerName localhost
php_value memory_limit 128M
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
并降低相关站点配置中的同一文件:
<VirtualHost *:80>
DocumentRoot "/Users/Username/Dropbox/Dev/sitename.dev"
ServerName sitename.dev
php_value memory_limit 128M
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
(顺便说一下,我把我的MAMP文件夹(Dev)保存在Dropbox中,它工作正常)
php.ini中
我还在我的站点目录的根目录和我的MAMP目录的根目录中添加了一个php.ini文件,其中包含以下内容:
memory_limit = 128M
Run Code Online (Sandbox Code Playgroud) 我听说过这个问题很复杂.我知道当你坚持在模板中简单地启用PHP并解决问题时,这很容易.但是,它几乎总是会引入潜在的安全问题,并使您的模板混乱.
在使用PHP的大多数情况下,在PHP中编写一个简单的插件来实现您的需求会更加清晰.
我的问题是:在ExpressionEngine模板中使用PHP是否可以接受?或者这被认为是不好的做法?如果您是继承我编码的网站的开发人员,如果您在模板中看到PHP,您会感到畏缩吗?
嗨,我有以下代码:
<div class="row-fluid">
<div class="span12">
<h3>Top 10 most popular</h3>
<ul>
{exp:channel:entries channel="faqs" dynamic="no" limit="10"}
<li><a href="{url_title_path='help'}">{title}</a></li>
{/exp:channel:entries}
</ul>
<h3>Answer to selected question</h3>
{exp:channel:entries channel="faqs" dynamic="yes" require_entry="yes" limit="1"}
{if no_results}
<p>Click a question above to see the answer here</p>
{/if}
{answer}
{/exp:channel:entries}
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
所以你可以看到我在两次循环faqs.第一个设置它来获取所有问题,然后如果用户点击一个问题,那么第二个循环应该启动时向他们展示答案.除了第二个循环中的无结果语句不起作用之外,这样可以正常工作.它永远不会得到输出.谁知道为什么?
我使用标准的搜索模块标签为ExpressionEngine网站添加了搜索功能.但是,我偶尔会遇到此错误消息:
您只能每15秒搜索一次.
这似乎只有在我退出时才会发生.
我希望减少搜索之间所需的时间.我该怎么调整呢?
我使用MSM插件在两个不同的域名上运行两个ExpressionEngine站点.站点1包含所有系统文件等,站点2位于站点1的子文件夹中.我的问题是如何让网站二没有在URL中的index.php文件仍然有效?
目前我在我的网站一的htaccess文件夹中有这个,网站一个很好,网站二没有:
<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
DirectoryIndex index.html index.php
# Redirect non-www urls to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# If 404s, "No Input File" or every URL returns the same thing
# make it /index.php?/$1 above (add the question mark)
Run Code Online (Sandbox Code Playgroud)
在控制面板中,"网站名称"的"管理">"常规配置"中有一个设置.
此处输入的值显示在控制面板的右上角.
是否有配置覆盖设置此值,以节省必须通过控制面板键入?
谢谢,
斯蒂芬
我使用ExpressionEngine 2.5.3和Google Maps for ExpressionEngine 3.0.190(又名3.1 beta),代码如下:
{exp:gmap:init id="map1" class="gmap" scrollwheel="false" style="width:930px;height:500px" clusterStyles="{url: '/assets/images/cluster-icon-blue.png', textColor: '#fff', textSize: '12', height: 52, width: 53, anchor: [0, 0]}" overviewMapControl="true" overviewMapControlOptions="{opened:true}"}
{exp:channel:entries channel="people" status="open" disable="categories|category_fields|member_data|pagination" limit="1000" dynamic="no" sort="asc"}
{cf_people_geo_location id="map1" show_one_window="true" icon="/assets/images/aabc-map-icon-white.png" infobox="true" offsetY="-45" offsetX="15" closeBoxMargin="5px" class="ui-infobox-dark" closeBoxURL="/themes/third_party/gmap/css/images/white-close-button.png" style="width: '250px'" clearanceX="10" show_one_window="true" clustering="true"}
<p><a href="/register/{url_title}/" title="View {title}">View {title} »</a></p>
{/cf_people_geo_location}
{/exp:channel:entries}
Run Code Online (Sandbox Code Playgroud)
是否可以设置地图在页面加载时使用的缩放级别?它似乎是根据绘制的点自动设置它,但我想覆盖这个值并放大几个凹槽.
谢谢,
STE
EE 2中是否有可替代旧EE 1缩写模块的附加组件?它允许您构建一个首字母缩略词数据库,您可以用任何东西替换它,包括链接文本.所以我在我的网站的一个部分使用它,我经常需要链接到相同的地方.使用该模块,每当我需要链接时,我都可以插入缩写词,并轻松地将其排序.如果通过在数据库中编辑而不是在使用它的每个帖子中更改链接,它还允许我轻松编辑这些链接.
我目前正在尝试合并两个不同步的表达式引擎数据库之间的数据更改。为此我选择使用 navicat。
该网站在模板中大量使用希腊字符集。当我在 phpmyadmin 中查看希腊语表字段数据时,我按预期看到了希腊语字符。当我将它们加载到 Navicat 中时,我只看到“???” 问号代替他们的位置。当我尝试在数据库之间同步数据时,结果是问号被放置在希腊字符的位置。
有问题的字段类型是使用“utf8_general_ci”的“文本”。
我究竟做错了什么?
expressionengine ×10
php ×2
codeigniter ×1
mamp ×1
memory-limit ×1
mysql ×1
navicat ×1
utf-8 ×1