Visualizzazione risultati 1 fino 12 di 12

Discussione: [prestashop] guida all'installazione

  1. #1
    Guest

    Predefinito [prestashop] guida all'installazione

    salve a tutti, scusate io ho un problema con la pagina index.php, io dovrei installare un programma dove nella cartella install è presente il file index.php interessato.
    il problema è che se lo lascio nel formato php altervista mi da un errore:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /membri/alfasrl/ps/install/classes/LanguagesManager.php on line 7

    invece se cambio l'estensione in html l'installazione ha inizio pero il problema che +è che non riesco a visualizzare bene la pagina perche è scritta in un altro formato. attendo aiutiiii grazie!!!!!!!!!

  2. #2
    palla000 non è connesso Utente attivo
    Data registrazione
    12-07-2008
    Residenza
    trieste
    Messaggi
    278

    Predefinito

    non riprendere post vecchi di due anni è meglio se ne apri un'altro
    comunque posta il codice di index.php

  3. #3
    Guest

    Predefinito

    il codice è molto lungo, te lo posto in piu parti: Parte1

    il codice di index.php relativo all'installazione è questo

    Codice PHP:
    <?php

    if (function_exists('date_default_timezone_set'))
    date_default_timezone_set('Europe/Paris');

    /* Redefine REQUEST_URI if empty (on some webservers...) */
    if (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == '')
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
    if (
    $tmp = strpos($_SERVER['REQUEST_URI'], '?'))
    $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, $tmp);

    define('INSTALL_VERSION', '1.1.0.5');
    define('MINIMUM_VERSION_TO_UPDATE', '0.8.5');
    define('INSTALL_PATH', dirname(__FILE__));
    define('PS_BASE_URI', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(substr($_SERVER['REQUEST_URI'],0,-1), strrpos( substr($_SERVER['REQUEST_URI'],0,-1),"/" )+1))));
    define('PS_BASE_URI_ABSOLUTE', 'http://'.htmlspecialchars($_SERVER["HTTP_HOST"], ENT_COMPAT, 'UTF-8').PS_BASE_URI);

    /* Old version detection */
    $oldversion = false;
    $sameVersions = false;
    $tooOld = true;
    if(
    file_exists(INSTALL_PATH.'/../config/settings.inc.php')){
    include(
    INSTALL_PATH.'/../config/settings.inc.php');
    $oldversion =_PS_VERSION_;
    $tooOld = (version_compare($oldversion, MINIMUM_VERSION_TO_UPDATE) == -1);
    $sameVersions = (version_compare($oldversion, INSTALL_VERSION) == 0);
    }

    include(
    INSTALL_PATH.'/classes/LanguagesManager.php');
    $lm = new LanguageManager(dirname(__FILE__).'/langs/list.xml');
    $_LANG = array();
    $_LIST_WORDS = array();
    function
    lang($txt) {
    global
    $_LANG , $_LIST_WORDS;
    return (isset(
    $_LANG[$txt]) ? $_LANG[$txt] : $txt);
    }
    if (
    $lm->getIncludeTradFilename())
    include_once(
    $lm->getIncludeTradFilename());
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo lang('PrestaShop '.INSTALL_VERSION.' Installer')?></title>
    <link rel="stylesheet" type="text/css" media="all" href="view.css"/>
    <script type="text/javascript" src="../js/jquery/jquery-1.2.6.pack.js"></script>
    <script type="text/javascript" src="../js/jquery/ajaxfileupload.js"></script>
    <script type="text/javascript" src="../js/jquery/jquery.pngFix.pack.js"></script>
    <script type="text/javascript" src="../js/jquery/jqminmax-compressed.js"></script>
    <link rel="shortcut icon" href="../img/favicon.ico" />

    <script type="text/javascript">
    //php to js vars
    var isoCodeLocalLanguage = "<?php echo $lm->getIsoCodeSelectedLang()?>";
    var ps_base_uri = "<?php echo PS_BASE_URI?>";

    //localWords
    var Step1Title = "<?php echo lang('Welcome').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step2title = "<?php echo lang('System compatibility').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step3title = "<?php echo lang('System configuration').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step4title = "<?php echo lang('Shop configuration').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step5title = "<?php echo lang('Ready, set, go!').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step6title = "<?php echo lang('Disclaimer').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step7title = "<?php echo lang('System compatibility').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step8title = "<?php echo lang('Errors while updating...').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var step9title = "<?php echo lang('Ready, set, go!').' - '.lang('PrestaShop '.INSTALL_VERSION.' Installer'); ?>";
    var txtNext = "<?php echo lang('Next')?>"
    var txtDbLoginEmpty = "<?php echo lang('Please set a database login'); ?>";
    var txtDbNameEmpty = "<?php echo lang('Please set a database name'); ?>";
    var txtDbServerEmpty = "<?php echo lang('Please set a database server name'); ?>";
    var txtSmtpAvailable = "<?php echo lang('SMTP connection is available!'); ?>";
    var txtSmtpError = "<?php echo lang('SMTP connection is unavailable'); ?>";
    var txtSmtpSrvEmpty = "<?php echo lang('Please set a SMTP server name'); ?>";
    var txtSmtpLoginEmpty = "<?php echo lang('Please set a SMTP login'); ?>";
    var txtSmtpPasswordEmpty = "<?php echo lang('Please set a SMTP password'); ?>";
    var txtNativeMailAvailable = "<?php echo lang('PHP \'mail()\' function is available'); ?>";
    var txtNativeMailError = "<?php echo lang('PHP \'mail()\' function is unavailable'); ?>";
    var txtDbCreated = "<?php echo lang('Database is created!'); ?>";
    var testMsg = "<?php echo lang('This is a test message, your server is now available to send email'); ?>";
    var testSubject = "<?php echo lang('Test message - Prestashop'); ?>";
    var mailSended = "<?php echo lang('An email has been sent!'); ?>";
    var mailSubject = "<?php echo lang('Congratulation, your online shop is now ready!'); ?>";
    var txtTabUpdater1 = "<?php echo lang('Welcome'); ?>";
    var txtTabUpdater2 = "<?php echo lang('Disclaimer'); ?>";
    var txtTabUpdater3 = "<?php echo lang('Verify system compatibility'); ?>";
    var txtTabUpdater4 = "<?php echo lang('Update is complete!'); ?>";
    var txtTabInstaller1 = "<?php echo lang('Welcome'); ?>";
    var txtTabInstaller2 = "<?php echo lang('Verify system compatibility'); ?>";
    var txtTabInstaller3 = "<?php echo lang('System configuration'); ?>";
    var txtTabInstaller4 = "<?php echo lang('Shop configuration'); ?>";
    var txtTabInstaller5 = "<?php echo lang('Installation is complete!'); ?>";

    var txtError = new Array();
    txtError[0] = "<?php echo lang('Required field'); ?>";
    txtError[1] = "<?php echo lang('Too long!'); ?>";
    txtError[2] = "<?php echo lang('Fields are different!'); ?>";
    txtError[3] = "<?php echo lang('This email adress is wrong!'); ?>";
    txtError[4] = "<?php echo lang('Impossible to send the email!'); ?>";
    txtError[5] = "<?php echo lang('Can\'t create settings file, if /config/settings.inc.php exists, please give the public write permissions to this file, else please create a file named settings.inc.php in config directory.'); ?>";
    txtError[6] = "<?php echo lang('Can\'t write settings file, please create a file named settings.inc.php in config directory.'); ?>";
    txtError[7] = "<?php echo lang('Impossible to upload the file!'); ?>";
    txtError[8] = "<?php echo lang('Data integrity is not valided. Hack attempt ?'); ?>";
    txtError[9] = "<?php echo lang('Impossible the read the content of a MySQL content file.'); ?>";
    txtError[10] = "<?php echo lang('Impossible the access the a MySQL content file.'); ?>";
    txtError[11] = "<?php echo lang('Error while inserting data in the database:'); ?>";
    txtError[12] = "<?php echo lang('The password is incorrect (alphanumeric string at least 8 characters).'); ?>";
    txtError[14] = "<?php echo lang('A Prestashop database already exists, please drop it or change the prefix.'); ?>";
    txtError[15] = "<?php echo lang('This is not a valid file name.'); ?>";
    txtError[16] = "<?php echo lang('This is not a valid image file.'); ?>";
    txtError[17] = "<?php echo lang('Error while creating the /config/settings.inc.php file.'); ?>";
    txtError[18] = "<?php echo lang('Error:'); ?>";
    txtError[19] = "<?php echo lang('This PrestaShop database already exists. Please revalidate your authentication informations to the database.'); ?>";
    txtError[22] = "<?php echo lang('An error occured while resizing the picture.'); ?>";
    txtError[23] = "<?php echo lang('Database connection is available!'); ?>";
    txtError[24] = "<?php echo lang('Database Server is available but database is not found'); ?>";
    txtError[25] = "<?php echo lang('Database Server is not found. Please verify the login, password and server fields.'); ?>";
    txtError[26] = "<?php echo lang('An error occured while sending email, please verify your parameters.'); ?>";
    txtError[37] = "<?php echo lang('Impossible to write the image /img/logo.jpg. If this image already exists, please delete it.'); ?>";
    txtError[38] = "<?php echo lang('The uploaded file exceeds the upload_max_filesize directive in php.ini'); ?>";
    txtError[39] = "<?php echo lang('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'); ?>";
    txtError[40] = "<?php echo lang('The uploaded file was only partially uploaded'); ?>";
    txtError[41] = "<?php echo lang('No file was uploaded.'); ?>";
    txtError[42] = "<?php echo lang('Missing a temporary folder'); ?>";
    txtError[43] = "<?php echo lang('Failed to write file to disk'); ?>";
    txtError[44] = "<?php echo lang('File upload stopped by extension'); ?>";
    txtError[45] = "<?php echo lang('Cannot convert your database\'s data to utf-8.'); ?>";
    txtError[999] = "<?php echo lang('No error code available.'); ?>";
    //upgrader
    txtError[27] = "<?php echo lang('This installer is too old.'); ?>";
    txtError[28] = "<?php echo lang('You already have the '.INSTALL_VERSION.' version.'); ?>";
    txtError[29] = "<?php echo lang('There is no older version. Did you delete or rename the config/settings.inc.php file ?'); ?>";
    txtError[30] = "<?php echo lang('The config/settings.inc.php file was not found. Did you delete or rename this file ?'); ?>";
    txtError[31] = "<?php echo lang('Can\'t find the sql upgrade files. Please verify that the /install/sql/upgrade folder is not empty)'); ?>";
    txtError[32] = "<?php echo lang('No upgrade is possible.'); ?>";
    txtError[33] = "<?php echo lang('Error while loading sql upgrade file.'); ?>";
    txtError[34] = "<?php echo lang('Error while inserting content into the database'); ?>";

    EDIT:
    è questo quello che dicevi? altrimenti non continuo... perche è davvero molto lungo
    Ultima modifica di seneca : 16-05-2009 alle ore 00.30.44

  4. #4
    Guest

    Predefinito

    Secondo me basta postare le prime 10 righe del file che si trova nella cartella
    install -> classes -> LanguagesManager.php, dato che l'errore sta lì...

    P.S. usa i tag appositi per postare il codice...

  5. #5
    palla000 non è connesso Utente attivo
    Data registrazione
    12-07-2008
    Residenza
    trieste
    Messaggi
    278

    Predefinito

    si scusate ho sbagliato io mi sembrava che l'errore fosse in index.php

  6. #6
    Guest

    Predefinito

    Citazione Originalmente inviato da nokiagames Visualizza messaggio
    Secondo me basta postare le prime 10 righe del file che si trova nella cartella
    install -> classes -> LanguagesManager.php, dato che l'errore sta lì...

    P.S. usa i tag appositi per postare il codice...
    ecco questo è il codice che mi hai chiesto...io nn lo conosco il linguaggio php quindi se riesci a trovarlo l'errore mi faresti un grossisimo favore!!! grazie

    Codice PHP:
    <?php

    include_once("../classes/Validate.php");

    class
    LanguageManager {

    private
    $url_xml;
    private
    $lang;
    private
    $xml_file;

    function
    __construct ($url_xml){
    $this->loadXML($url_xml);
    $this->setLanguage();
    $this->getIncludeTradFilename();

    }


    private function
    loadXML($url_xml){
    global
    $errors;
    if(!
    $this->xml_file = simplexml_load_file($url_xml))
    $errors = "Error when loading XML language file : $url_xml";
    }

    public function
    getIdSelectedLang(){
    return
    $this->lang['id'];
    }

    public function
    getIsoCodeSelectedLang(){
    return
    $this->lang->idLangPS;
    }

    public function
    countLangs(){
    return
    sizeof($this->xml_file);
    }

    public function
    getAvailableLangs(){
    return
    $this->xml_file;
    }

    public function
    getSelectedLang(){
    return
    $this->lang;
    }

    private function
    getIdByHAL(){

    $iso = false;

    if (isset(
    $_SERVER['HTTP_ACCEPT_LANGUAGE'])) {

    $FirstHAL = split(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
    $iso = $FirstHAL[0];

    if (
    $iso != "en-us" ) {
    foreach (
    $this->xml_file as $lang){
    foreach (
    $lang->isos->iso as $anIso){
    if (
    $anIso == $iso) return $lang['id'];
    }
    }
    }

    } else return
    0;

    }

    private function
    setLanguage(){
    if( isset(
    $_GET['language']) AND Validate::isInt($_GET['language'])){
    $id_lang = intval($_GET['language']);
    }
    if (!isset(
    $id_lang)) {
    $id_lang = ($this->getIdByHAL());
    }

    $this->lang = $this->xml_file->lang[intval($id_lang)];


    }

    public function
    getIncludeTradFilename(){
    return (
    $this->lang == NULL) ? false : dirname(__FILE__).$this->lang['trad_file'];
    }

    }

    ?>
    Ultima modifica di seneca : 16-05-2009 alle ore 00.31.24

  7. #7
    palla000 non è connesso Utente attivo
    Data registrazione
    12-07-2008
    Residenza
    trieste
    Messaggi
    278

    Predefinito

    l'errore sono le prime tre variabili (linea 7-8-9) a causa di quel public che non so a cosa serva perchè io non uso le classi comunque quello è l'errore

  8. #8
    Guest

    Predefinito

    ho capito grazie... ma tu nn sapresti rizolverlo? scusa per linsistenza ma ti ripeto che io il pho nn lo conosco

  9. #9
    palla000 non è connesso Utente attivo
    Data registrazione
    12-07-2008
    Residenza
    trieste
    Messaggi
    278

    Predefinito

    prova a cambiare tutti i private in public

  10. #10
    L'avatar di seneca
    seneca non è connesso Super Moderatore
    Data registrazione
    18-12-2004
    Residenza
    la Città Eterna
    Messaggi
    8,376

    Predefinito

    Ma qual è quest'applicazione di cui parli all'inizio e che stai tentando di installare?
    Dove l'hai scaricata?

    Usa i tag appositi per il codice, migliori la visualizzazione
    Attendo questi chiarimenti per poi dividere la discussione dal resto del 2006...


    -- Aut Roma Aut Nihil!

  11. #11
    Guest

    Predefinito

    Citazione Originalmente inviato da seneca Visualizza messaggio
    Ma qual è quest'applicazione di cui parli all'inizio e che stai tentando di installare?
    Dove l'hai scaricata?

    Usa i tag appositi per il codice, migliori la visualizzazione
    Attendo questi chiarimenti per poi dividere la discussione dal resto del 2006...
    sto cercando di installare prestashop e l'ho scaricato gratuitamente dal sito...per quanto riguarda i tag per i codici nn so usarli perche sono nuovo di qui...scusate

  12. #12
    L'avatar di seneca
    seneca non è connesso Super Moderatore
    Data registrazione
    18-12-2004
    Residenza
    la Città Eterna
    Messaggi
    8,376

    Predefinito

    Ti consiglio di cancellare tutti i file che hai caricato, riprendere i file originali e ricominciare l'installazione da capo.
    Prima di tutto ciò, attiva il php 5 sul tuo account, nel tuo pannello di gestione di altervista.


    -- Aut Roma Aut Nihil!

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •