จะ Migrate web ที่มี VirtueMart ไปใส่จาก Joomla 2.5 ธรรมดา (ทั้ง 2 web อยู่ในเครื่อง desktop)
ขั้นตอนที่ทำ
1 export ข้อมูลจาก MySQL จาก DB VirtueMart เป็น SQL ชื่อ e-comm.sql
2 drop DB ใน web Joomla 2.5
3 copy directory ต่างๆ จาก web VirtueMart มาใส่ web Joomla 2.5 ให้เขียนทับ folder เก่า
4 execute e-comm.sql เพื่อสร้าง web ที่มี VirtueMart ใน web Joomla 2.5
ทีนี้พอลองเข้า htpp://localhost/
web-name มันมีข้อความก่อน Banner ของ web
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\xampp\htdocs\
web-name\configuration.php:1) in D:\xampp\htdocs\
web-name\libraries\joomla\session\session.php on line 423
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\
web-name\configuration.php:1) in D:\xampp\htdocs\
web-name\libraries\joomla\session\session.php on line 423
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\
web-name\configuration.php:1) in D:\xampp\htdocs\
web-name\libraries\joomla\session\session.php on line 426
แล้วก็ยังมีในส่วนเนื้อหา
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\
web-name\configuration.php:1) in D:\xampp\htdocs\
web-name\administrator\components\com_virtuemart\classes\ps_session.php on line 68
ซึ่ง code ใน session.php และ ps_session.php ผมไม่ได้แก้ไขอะไรเลย
session.php
function _start()
{
// start session if not startet
if( $this->_state == 'restart' ) {
session_id( $this->_createId() );
}
session_cache_limiter('none');
session_start(); <------- บรรทัดที่ 423
// Send modified header for IE 6.0 Security Policy
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); <---- บรรทัดที่ 426
return true;
}
ps_session.php
function initSession() {
global $vmLogger, $mainframe, $mosConfig_absolute_path, $VM_LANG;
// We only care for the session if it is not started!
if( empty( $_SESSION ) || session_id() == '') {
if(ini_get('session.session_save_handler') == 'files') {
// Check if the session_save_path is writable
$this->checkSessionSavePath();
}
session_name( $this->_session_name );
if( @$_REQUEST['option'] == 'com_virtuemart' ) {
ob_start();// Fix for the issue that printed the shop contents BEFORE the page begin
}
@session_start();
if( !empty($_SESSION) && !empty($_COOKIE[$this->_session_name])) {
$vmLogger->debug( 'A Session called '.$this->_session_name.' (ID: '.session_id().') was successfully started!' );
}
else {
}
}
else {
if( empty( $_COOKIE['virtuemart']) ) {
setcookie('virtuemart', $this->getSessionId() ); <---- บรรทัดที่ 68
if( USE_AS_CATALOGUE == '' ) {
$vmLogger->debug( 'A Cookie had to be set to keep the session (there was none - does your Browser keep the Cookie?) although a Session already has been started! If you see this message on each page load, your browser doesn\'t accept Cookies from this site.' );
}
}
$vmLogger->debug( 'Using existing Session '.session_name().', ID: '.session_id().'.');
}
// Cookie Check
// Introduced to check if the user-agent accepts cookies
if( @$_REQUEST['option'] == 'com_virtuemart' && empty($_GET['martID'])
&& USE_AS_CATALOGUE != '1' && VM_ENABLE_COOKIE_CHECK == '1' && !vmIsAdminMode() ) {
$this->doCookieCheck();
}
}
ต้องแก้ไขเพิ่มเติมอะไรใน configuration หรือเปล่า
ขอความช่วยเหลือคนใช้ Joomla ด้วยครับ
ขั้นตอนที่ทำ
1 export ข้อมูลจาก MySQL จาก DB VirtueMart เป็น SQL ชื่อ e-comm.sql
2 drop DB ใน web Joomla 2.5
3 copy directory ต่างๆ จาก web VirtueMart มาใส่ web Joomla 2.5 ให้เขียนทับ folder เก่า
4 execute e-comm.sql เพื่อสร้าง web ที่มี VirtueMart ใน web Joomla 2.5
ทีนี้พอลองเข้า htpp://localhost/web-name มันมีข้อความก่อน Banner ของ web
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\xampp\htdocs\web-name\configuration.php:1) in D:\xampp\htdocs\web-name\libraries\joomla\session\session.php on line 423
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\web-name\configuration.php:1) in D:\xampp\htdocs\web-name\libraries\joomla\session\session.php on line 423
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\web-name\configuration.php:1) in D:\xampp\htdocs\web-name\libraries\joomla\session\session.php on line 426
แล้วก็ยังมีในส่วนเนื้อหา
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\web-name\configuration.php:1) in D:\xampp\htdocs\web-name\administrator\components\com_virtuemart\classes\ps_session.php on line 68
ซึ่ง code ใน session.php และ ps_session.php ผมไม่ได้แก้ไขอะไรเลย
session.php
function _start()
{
// start session if not startet
if( $this->_state == 'restart' ) {
session_id( $this->_createId() );
}
session_cache_limiter('none');
session_start(); <------- บรรทัดที่ 423
// Send modified header for IE 6.0 Security Policy
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); <---- บรรทัดที่ 426
return true;
}
ps_session.php
function initSession() {
global $vmLogger, $mainframe, $mosConfig_absolute_path, $VM_LANG;
// We only care for the session if it is not started!
if( empty( $_SESSION ) || session_id() == '') {
if(ini_get('session.session_save_handler') == 'files') {
// Check if the session_save_path is writable
$this->checkSessionSavePath();
}
session_name( $this->_session_name );
if( @$_REQUEST['option'] == 'com_virtuemart' ) {
ob_start();// Fix for the issue that printed the shop contents BEFORE the page begin
}
@session_start();
if( !empty($_SESSION) && !empty($_COOKIE[$this->_session_name])) {
$vmLogger->debug( 'A Session called '.$this->_session_name.' (ID: '.session_id().') was successfully started!' );
}
else {
}
}
else {
if( empty( $_COOKIE['virtuemart']) ) {
setcookie('virtuemart', $this->getSessionId() ); <---- บรรทัดที่ 68
if( USE_AS_CATALOGUE == '' ) {
$vmLogger->debug( 'A Cookie had to be set to keep the session (there was none - does your Browser keep the Cookie?) although a Session already has been started! If you see this message on each page load, your browser doesn\'t accept Cookies from this site.' );
}
}
$vmLogger->debug( 'Using existing Session '.session_name().', ID: '.session_id().'.');
}
// Cookie Check
// Introduced to check if the user-agent accepts cookies
if( @$_REQUEST['option'] == 'com_virtuemart' && empty($_GET['martID'])
&& USE_AS_CATALOGUE != '1' && VM_ENABLE_COOKIE_CHECK == '1' && !vmIsAdminMode() ) {
$this->doCookieCheck();
}
}
ต้องแก้ไขเพิ่มเติมอะไรใน configuration หรือเปล่า