Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ช่วยทีครับ Prestashop Error แบบนี้ Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must be as long as the blocksize in D:\www\siamnas\classes\Rijndael.php on line 61



 

ช่วยทีครับ Prestashop Error แบบนี้ Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must be as long as the blocksize in D:\www\siamnas\classes\Rijndael.php on line 61

 



Topic : 082723



โพสกระทู้ ( 1,095 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์




ผมได้ทำการดาวโหลด Prestashop จากบน เซิฟเวอร์ มาทดลองรันบนเครื่องตัวเองครับ


ไม่ทราบว่ามีท่านใดเล่น prestashop อยู่บ้างช่วยแนะนำด้วยครับ

extension=php_mcrypt.dll เปิดแล้วหน่ะครับ

และก็อบไฟล์ libmcrypt.dll ไปไว้ที่ c:/windows เรียบร้อย รีสตาร์ทเครื่องแล้วทดลองรัน

พอทำการรันเกิด error แบบนี้ครับ

Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must be as long as the blocksize in D:\www\siamnas\classes\Rijndael.php on line 61

และระบบทำงานไม่สมบูรณ์ครับ


ส่วน บนเซิฟเวอร์ ทำงานเป็นปกติ ครับ


พอดีผมจะแก้ไขงานต่อเขาหน่ะครับ

ส่วนนี้คือไฟล์ Rijndael.php ครับ

Code (PHP)
<?php
/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 14001 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

class RijndaelCore
{
	protected $_key;
	protected $_iv;
	
	public function __construct($key, $iv)
	{
		$this->_key = $key;
		$this->_iv = base64_decode($iv);
	}
	
	// Base64 is not required, but it is be more compact than urlencode
	public function encrypt($plaintext)
	{
		$length = (ini_get('mbstring.func_overload') & 2) ? mb_strlen($plaintext, ini_get('default_charset')) : strlen($plaintext);

        if ($length >= 1048576)
			return false;
		return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->_key, $plaintext, MCRYPT_MODE_ECB, $this->_iv)).sprintf('%06d', $length);
	}

	public function decrypt($ciphertext)
	{
		if (ini_get('mbstring.func_overload') & 2)
		{
			$plainTextLength = intval(mb_substr($ciphertext, -6, 6, ini_get('default_charset')));
			$ciphertext = mb_substr($ciphertext, 0, -6, ini_get('default_charset'));
			return mb_substr(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $this->_key, base64_decode($ciphertext), MCRYPT_MODE_ECB, $this->_iv), 0, $plainTextLength, ini_get('default_charset'));
		}
		else
		{
			$plainTextLength = intval(substr($ciphertext, -6));
			$ciphertext = substr($ciphertext, 0, -6);
			return substr(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $this->_key, base64_decode($ciphertext), MCRYPT_MODE_ECB, $this->_iv), 0, $plainTextLength);
		}
	}
}






Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-08-22 11:45:43 By : ไวยวิทย์ View : 1538 Reply : 2
 

 

No. 1



โพสกระทู้ ( 5,105 )
บทความ ( 4 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


อ่านของต่างประเทศดูครับ ไม่เข้าใจเหมือนกัน แต่เห็นว่ามันคล้าย ๆ กัน
http://stackoverflow.com/questions/4149603/issue-with-php-mcrypt-function






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-22 13:08:34 By : apisitp
 


 

No. 2



โพสกระทู้ ( 1,095 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ขอบคุณครับ ที่ช่วยค้นหาครับ เดี๋ยวผมนำไปทดลองก่อนครับ

ตอนนี้กำลังย้าย ฐานข้อมูลของ prestashop 1.3 ไป 1.4

แต่ไม่เอาสินค้าทั้งหมด เอาเฉพาะ ชนิดเดียวเท่านั้น ซึ่งฟิวฐานข้อมูลของ 1.3 กะ 1.4 ไม่เหมียนกัลเลย

1.4 จะมีฟิวเพิ่มเ้ข้ามา

กำลังคิดอยู่ว่าจะให้เขาเพิ่มมือเอง


มึนครับผม
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-22 14:27:53 By : ไวยวิทย์
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยทีครับ Prestashop Error แบบนี้ Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must be as long as the blocksize in D:\www\siamnas\classes\Rijndael.php on line 61
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่