magento安装组件时出现Fatal error: Allowed memory size错误的解决

magento安装组件时出现类似如下的错误,
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 84 bytes) in /public_html/app/code/core/Mage/Core/Model/Config.php on line 1254

这种情况基本上是php的配置有问题造成的,
php.ini修改memory_limit值即可以解决问题
php_value memory_limit 64M
php_value max_execution_time 18000
然后记得重启apache服务,即可生效.

Magento: Category Flat Data reindex时General error: 1005错误解决

在magento进行Category Flat Data索引有呾,并出现如下错误内容:
‘Zend_Db_Statement_Exception’ with message ‘SQLSTATE[HY000]: General error: 1005 Can’t create table ‘xxx catalog_category_flat_store_1.frm’ (errno: 150)’ in xxx/lib/Zend/Db/Statement/Pdo.php:234

解决方法:
在phpMyAdmin中运行如下:
ALTER TABLE catalog_category_entity ENGINE=INNODB
ALTER TABLE core_store ENGINE=INNODB

magento在属性过滤时出现You cannot define a correlation name错误的解决办法

magento在产品目录页的属性过滤时,会出现You cannot define a correlation name错误
换一个模板又不会出现,不知什么原因,但解决办法如下:
1.打开/lib/Zend/Db/select.php
2.注释select.php文件中的下列代码
throw new Zend_Db_Select_Exception("You cannot define a correlation name '$correlationName' more than once");
3.清楚缓存
再试试,就应该可以了。
但出现这个问题的原因,以有些奇怪了,正常引起这个问题的应是code的代码,但同一个数据换个模板,却正常。

利用.htaccess的设置来显示PHP错误的方法

用.htaccess设置显示PHP错误

使用.htaccess可以在某种程度上更改PHP的错误显示的设置,实际上,相当于更改PHP.ini的参数,很是方便。
将以下相应代码放到对应目录中的.htaccess文件,即可实现相应功能。
关闭错误显示
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0

只显示PHP错误

php_flag  display_errors        on
php_flag  display_startup_errors on
php_value error_reporting        2047

其中,“2047”为要显示的错误的级别,详细表格如下:

1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING
64 E_COMPILE_ERROR
128 E_COMPILE_WARNING
256 E_USER_ERROR
512 E_USER_WARNING
1024 E_USER_NOTICE
2047 E_ALL
2048 E_STRICT
4096 E_RECOVERABLE_ERROR 

把错误保存到日志文件中 ,可以这样设置:

# enable PHP error logging
php_flag  log_errors on
php_value error_log  /home/path/public_html/domain/PHP_errors.log

然后,可以设置不允许访问.log文件

# prevent access to PHP error log
<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

设置错误日志的最大体积 ,以bytes为单位:

# general directive for
 setting max error size
log_errors_max_len integer

综合上述,.htaccess的PHP错误显示设置汇总

# PHP error handling for production servers

# disable display of startup errors
php_flag display_startup_errors off

# disable display of all other errors
php_flag display_errors off

# disable html markup of errors
php_flag html_errors off

# enable logging of errors
php_flag log_errors on

# disable ignoring of repeat errors
php_flag ignore_repeated_errors off

# disable ignoring of unique source errors
php_flag ignore_repeated_source off

# enable logging of php memory leaks
php_flag report_memleaks on

# preserve most recent error via php_errormsg
php_flag track_errors on

# disable formatting of error reference links
php_value docref_root 0

# disable formatting of error reference links
php_value docref_ext 0

# specify path to php error log
php_value error_log /home/path/public_html/domain/PHP_errors.log

# specify recording of all php errors
php_value error_reporting 999999999

# disable max error string length
php_value log_errors_max_len 0

# protect error log by preventing public access
<Files /home/path/public_html/domain/PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

以下则是适合开发者应用的设置:

# PHP error handling for
 development servers
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /home/path/public_html/domain/PHP_errors.log
php_value error_reporting 999999999
php_value log_errors_max_len 0

<Files /home/path/public_html/domain/PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

总之,通过.htaccess设置显示PHP错误
来控制PHP错误是否显示似乎更方便。。

magento在后台编辑保存产品时出现500错误

magento在后台编辑保存产品时出现500错误,
找了别人blog,说大致以下问题
下面是一些常见的会导致http 500的原因:

1. 文件权限不够

2.运行内存限制

3.运行时间限制

4. .htaccess文件设置问题

5.网站文件的问题

我把内存和运行时间都做了提高,都不行。
最后想想,可能的media权限不够,于是试了运行
chmod -R o+w media
居然可以了,不可理解!!

webmin验证系统时出现error: stat of /var/log/cron failed: No such file or directory错误

webmin验证系统时出现error: stat of /var/log/cron failed: No such file or directory错误的解决办法:

# /etc/init.d/rsyslog status
rsyslogd is stopped
rklogd is stopped

# /etc/init.d/rsyslog start
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]

Check if the service is being started at the starup :

 

# chkconfig –list | grep rsyslog
rsyslog 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Use Command to enable the daemon at startup

# chkconfig rsyslog on

Fatal error: Class ‘notifier’ not found and other error的zen-cart错误

Fatal error: Class ‘notifier’ not found and other error    includes/autoload_func.php on line 79之类的错误,解决办法是
在includes/configure.php中检查以下类似的代码
define(‘DIR_FS_CATALOG’, ‘domainname/subdomain’);
应改表示成以下格式,注意尾部增加一个/
define(‘DIR_FS_CATALOG’, ‘domainname/subdomain/’);

重启apache2遇到错误:Could not reliably determine the server’s fully qualified domain name

重启apache2的时候,提示这个错误

Forcing reload of web server (apache2)…apache2: Could not reliably determine the server’s fully qualified domain name, using 10.35.12.112 for ServerName
waiting apache2: Could not reliably determine the server’s fully qualified domain name, using ***.***.***.*** for ServerName

其实只要这样

vi /etc/httpd/conf/httpd.conf

ServerName      YourIpAddress:80

Webmin\Virtualmin中增加网站出现Table ‘mysql.host’ doesn’t exist的错误

Webmin\Virtualmin中增加网站出现Table ‘mysql.host’ doesn’t exist的错误

第一种解决办法是:进入Mysql的bin目录运行mysql -u root -p mysql
输入密码后运行
mysql> SOURCE ../share/mysql_fix_privilege_tables.sql
这种办法应该是Repair数据库吧?
第二种解决办法是:
CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

Webmin/Virtualmin的apache出现MaxClients和ServerLimit错误的解决

 /etc/httpd/conf.d/swtune.conf里面有
ServerLimit       10  
MaxClients        10  
太小了,解决办法:
mv /etc/httpd/conf.d/swtune.conf /etc/httpd/conf.d/swtune.con
然后重启apache,
service httpd resart
搞定!
经过分析,只有Webmin/Virtualmin的平台才有这个文件,其它如whm/cpanel的平台,没有这个问题.