1.PHP Fatal Error: Call to undefined method PHPExcel_Reader_CSV::setReadDataOnly() in *****************2012\admin\model\tool\export.php on line 1481
咋整呢?
这个问题主要是因为使用 windows 虚拟主机 的原因造成的,windows下禁用了 一些php函数 导致程序运行错误,
解决方法如下: (我没有windows主机测试,应该可以解决,大家试试如果不行在问我)
找到文件:
\opencart\admin\model\tool\export.php
找到
function upload( $filename ) {
….中间省略
}
把这段替换为:
function upload( $filename ) {
global $config;
global $log;
$config = $this->config;
$log = $this->log;
set_error_handler('error_handler_for_export',E_ALL);
register_shutdown_function('fatal_error_shutdown_handler_for_export');
$database =& $this->db;
ini_set("memory_limit","512M");
ini_set("max_execution_time",180);
//set_time_limit( 60 );
//chdir( '../system/PHPExcel' );
require_once( '../system/PHPExcel/Classes/PHPExcel.php' );
//chdir( '../../admin' );
$inputFileType = PHPExcel_IOFactory::identify($filename);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objReader->setReadDataOnly(true);
$reader = $objReader->load($filename);
$ok = $this->validateUpload( $reader );
if (!$ok) {
return FALSE;
}
$this->clearCache();
$ok = $this->uploadImages( $reader, $database );
if (!$ok) {
return FALSE;
}
$ok = $this->uploadCategories( $reader, $database );
if (!$ok) {
return FALSE;
}
$ok = $this->uploadProducts( $reader, $database );
if (!$ok) {
return FALSE;
}
$ok = $this->uploadOptions( $reader, $database );
if (!$ok) {
return FALSE;
}
$ok = $this->uploadAttributes( $reader, $database );
if (!$ok) {
return FALSE;
}
$ok = $this->uploadSpecials( $reader, $database );
if (!$ok) {
return FALSE;
}
$ok = $this->uploadDiscounts( $reader, $database );
if (!$ok) {
return FALSE;
}
//chdir( '../../..' );
return $ok;
}
(责任编辑:最模板) |