Jump to content

Prestashop unexpected 'true' (T_STRING)


Recommended Posts

Hola tengo un problema con mi tienda en prestashop, comenzó porque quise actualizar la teinda a prestashop 1.6 (tengo el 1.5.6) y me di cuenta que tenía un problema de espacio en el servidor, estaba lleno y ya no podía subir o cambiar nada porque salía 'data quote excceded' así que cambié de servidor haciendo los backups de tienda y base de datos (según este post http://www.prestashop.com/forums/topic/180411-cambio-de-hosting-solucionado/ )y los subí al nuevo servidor.

 

El problema es que ahora me sale este error: syntax error, unexpected 'true' (T_STRING) in \tienda\config\defines.inc.php on line 28

 

Cambié 'true' por 'false' pero entonces se cambia el error por " 'false' (T_STRING)"

 

He buscado por el foro pero no veo ninguna solución o alternativa, alguien sabe cómo puedo solucionar este error?

 

Mi prestashop es 1.5.6

Link to comment
Share on other sites

El archivo defines.inc.php está así:
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

/* Debug only */
define('_PS_MODE_DEV_'true);
if (_PS_MODE_DEV_)
{
    @ini_set('display_errors', 'on');
    @error_reporting(E_ALL | E_STRICT);
    define('_PS_DEBUG_SQL_', true);
    /* Compatibility warning */
    define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
}
else
{
    @ini_set('display_errors', 'off');
    define('_PS_DEBUG_SQL_', false);
    /* Compatibility warning */
    define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
}

define('_PS_DEBUG_PROFILING_', false);
define('_PS_MODE_DEMO_', false);

$currentDir = dirname(__FILE__);

if (!defined('PHP_VERSION_ID'))
{
    $version = explode('.', PHP_VERSION);
    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}

/* Directories */
define('_PS_ROOT_DIR_', realpath($currentDir.'/..'));
define('_PS_CLASS_DIR_',            _PS_ROOT_DIR_.'/classes/');
define('_PS_CONTROLLER_DIR_',       _PS_ROOT_DIR_.'/controllers/');
define('_PS_FRONT_CONTROLLER_DIR_', _PS_ROOT_DIR_.'/controllers/front/');
define('_PS_ADMIN_CONTROLLER_DIR_', _PS_ROOT_DIR_.'/controllers/admin/');
define('_PS_OVERRIDE_DIR_', _PS_ROOT_DIR_.'/override/');
define('_PS_TRANSLATIONS_DIR_', _PS_ROOT_DIR_.'/translations/');
define('_PS_DOWNLOAD_DIR_',         _PS_ROOT_DIR_.'/download/');
define('_PS_MAIL_DIR_',             _PS_ROOT_DIR_.'/mails/');
define('_PS_PDF_DIR_', _PS_ROOT_DIR_.'/pdf/');
define('_PS_ALL_THEMES_DIR_',       _PS_ROOT_DIR_.'/themes/');
define('_PS_IMG_DIR_',              _PS_ROOT_DIR_.'/img/');
if (!defined('_PS_MODULE_DIR_'))
    define('_PS_MODULE_DIR_',              _PS_ROOT_DIR_.'/modules/');
define('_PS_CAT_IMG_DIR_',          _PS_IMG_DIR_.'c/');
define('_PS_STORE_IMG_DIR_',        _PS_IMG_DIR_.'st/');
define('_PS_PROD_IMG_DIR_',         _PS_IMG_DIR_.'p/');
define('_PS_SCENE_IMG_DIR_',        _PS_IMG_DIR_.'scenes/');
define('_PS_SCENE_THUMB_IMG_DIR_',  _PS_IMG_DIR_.'scenes/thumbs/');
define('_PS_MANU_IMG_DIR_',         _PS_IMG_DIR_.'m/');
define('_PS_SHIP_IMG_DIR_',         _PS_IMG_DIR_.'s/');
define('_PS_SUPP_IMG_DIR_',         _PS_IMG_DIR_.'su/');
define('_PS_COL_IMG_DIR_',            _PS_IMG_DIR_.'co/');
define('_PS_TMP_IMG_DIR_',          _PS_IMG_DIR_.'tmp/');
define('_PS_UPLOAD_DIR_',            _PS_ROOT_DIR_.'/upload/');
define('_PS_TOOL_DIR_', _PS_ROOT_DIR_.'/tools/');
define('_PS_GEOIP_DIR_',            _PS_TOOL_DIR_.'geoip/');
define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_.'swift/');
define('_PS_GENDERS_DIR_',            _PS_IMG_DIR_.'genders/');
define('_PS_FPDF_PATH_',            _PS_TOOL_DIR_.'fpdf/'); // @deprecated will be removed in 1.6
define('_PS_TCPDF_PATH_',            _PS_TOOL_DIR_.'tcpdf/');
define('_PS_TAASC_PATH_',            _PS_TOOL_DIR_.'taasc/');
define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_.'pear_xml_parser/');
define('_PS_CACHE_DIR_',            _PS_ROOT_DIR_.'/cache/');
/* BO THEMES */
if (defined('_PS_ADMIN_DIR_'))
    define('_PS_BO_ALL_THEMES_DIR_',            _PS_ADMIN_DIR_.'/themes/');

/* settings php */
define('_PS_TRANS_PATTERN_',            '(.*[^\\\\])');
define('_PS_MIN_TIME_GENERATE_PASSWD_', '360');
if (!defined('_PS_MAGIC_QUOTES_GPC_'))
    define('_PS_MAGIC_QUOTES_GPC_',         get_magic_quotes_gpc());

define('_CAN_LOAD_FILES_', 1);

/* Order states
Order states has been moved in config.inc.php file for backward compatibility reasons */

/* Tax behavior */
define('PS_PRODUCT_TAX', 0);
define('PS_STATE_TAX', 1);
define('PS_BOTH_TAX', 2);

define('_PS_PRICE_DISPLAY_PRECISION_', 2);
define('PS_TAX_EXC', 1);
define('PS_TAX_INC', 0);

define('PS_ORDER_PROCESS_STANDARD', 0);
define('PS_ORDER_PROCESS_OPC', 1);

define('PS_ROUND_UP', 0);
define('PS_ROUND_DOWN', 1);
define('PS_ROUND_HALF', 2);

/* Registration behavior */
define('PS_REGISTRATION_PROCESS_STANDARD', 0);
define('PS_REGISTRATION_PROCESS_AIO', 1);

/* Carrier::getCarriers() filter */
// these defines are DEPRECATED since 1.4.5 version
define('PS_CARRIERS_ONLY', 1);
define('CARRIERS_MODULE', 2);
define('CARRIERS_MODULE_NEED_RANGE', 3);
define('PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE', 4);
define('ALL_CARRIERS', 5);

/* SQL Replication management */
define('_PS_USE_SQL_SLAVE_', 0);

/* PS Technical configuration */
define('_PS_ADMIN_PROFILE_', 1);

/* Stock Movement */
define('_STOCK_MOVEMENT_ORDER_REASON_', 3);
define('_STOCK_MOVEMENT_MISSING_REASON_', 4);

/**
 * @deprecated 1.5.0.1
 * @see Configuration::get('PS_CUSTOMER_GROUP')
 */
define('_PS_DEFAULT_CUSTOMER_GROUP_', 3);

define('_PS_CACHEFS_DIRECTORY_', _PS_ROOT_DIR_.'/cache/cachefs/');

/* Geolocation */
define('_PS_GEOLOCATION_NO_CATALOG_', 0);
define('_PS_GEOLOCATION_NO_ORDER_', 1);

define('MIN_PASSWD_LENGTH', 8);

define('_PS_SMARTY_NO_COMPILE_', 0);
define('_PS_SMARTY_CHECK_COMPILE_', 1);
define('_PS_SMARTY_FORCE_COMPILE_', 2);

define('_PS_SMARTY_CONSOLE_CLOSE_', 0);
define('_PS_SMARTY_CONSOLE_OPEN_BY_URL_', 1);
define('_PS_SMARTY_CONSOLE_OPEN_', 2);

define('_PS_JQUERY_VERSION_', '1.7.2');
 

La dirección de la tienda es http://familycenter.co

Link to comment
Share on other sites

Ya lo arreglé y ahora sale esto:

 

Warning: mysql_connect(): Access denied for user 'dycil'@'localhost' (using password: YES) in /home/family/public_html/classes/db/MySQL.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/family/public_html/classes/db/MySQL.php:37) in /home/family/public_html/classes/exception/PrestaShopException.php on line 37

[PrestaShopDatabaseException]

Link to database cannot be established.
at line 38 in file classes/db/MySQL.php

32. 	{33. 		if (!defined('_PS_MYSQL_REAL_ESCAPE_STRING_'))34. 			define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string'));35. 36. 		if (!$this->link = mysql_connect($this->server, $this->user, $this->password))37. 			throw new PrestaShopDatabaseException(Tools::displayError('Link to database cannot be established.'));38. 39. 		if (!$this->set_db($this->database))40. 			throw new PrestaShopDatabaseException(Tools::displayError('The database selection cannot be made.'));41. 42. 		// UTF-8 support
Link to comment
Share on other sites

noté que el usuario de la base de datos era el equivocada, para la nueva base de datos me tocó crear otro usuario y contraseña, y los modifiqué en archivo settings.inc.php y ahora en la página me sale este error:

 

Fatal error: Call to undefined function mcrypt_encrypt() in /home/family/public_html/classes/Rijndael.php on line 50

 

En el archivo que se menciona la línea dic:

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

 

y completo dice:

 

<?php
/*
* 2007-2013 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-2013 PrestaShop SA
*  @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
     *
     * @param string $plaintext
     * @return bool|string
     */
    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)
        {
            $length = 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,
                $length,
                ini_get('default_charset')
            );
        }
        else
        {
            $length = 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, $length);
        }
    }
}
 

Link to comment
Share on other sites

Gracias a este post (http://www.prestashop.com/forums/topic/108071-error-en-prestashop-141-rijndaelphp-on-line-42/) pude solucionar el problema.

El problema era que no tenía Mcrypt así que lo tuve que hacer fue en el servidor poner esa configuración para el apache y PHP y crear el paquete y quedó :):D ya funciona perfecta la tienda, ahora sólo necesito saber cómo actualizarla a 1.6 y queda completa.

 

Gracias por la ayuda. ;)

Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...