Redirect

ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Redirect

Beitrag von ilias »

I have a problem,
i send my dns records of my server to a domain that hosting to another server.
But when it click the domain contenido types a problem:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/web46/html/contenido-neu/cms/front_content.php on line 204

The client name is psb and i change the name also in administration->client.
What i did wrong???

Best Regards
Ilias
thepoet
Beiträge: 55
Registriert: Mo 7. Jul 2003, 11:39
Wohnort: Vilsbiburg
Kontaktdaten:

Re: Redirect

Beitrag von thepoet »

Could it be that the new server is running an old PHP version (i.e. PHP 4.x) which doesn't support chaining method calls?

The offending line is (unless something was changed from the standard)

Code: Alles auswählen

Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);
and won't run in PHP4.
ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Re: Redirect

Beitrag von ilias »

Thanks for your quick reply, but i have php 5.2.

Propably something else is the problem.
Oldperl
Beiträge: 4316
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Hat sich bedankt: 6 Mal
Danksagung erhalten: 4 Mal
Kontaktdaten:

Re: Redirect

Beitrag von Oldperl »

Hi ilias

you may check the following points
  • Are there folders contenido/classes/Url and contenido/classes/UrlBuilder with some php classfiles in your web?
  • Are there the following entries at the end of contenido/includes/startup.php?

    Code: Alles auswählen

    // Initialize UrlBuilder, configuration is set in /contenido/includes/config.misc.php
    cInclude('classes', 'Url/Contenido_Url.class.php');
    cInclude('classes', 'UrlBuilder/Contenido_UrlBuilderConfig.class.php');
    Contenido_UrlBuilderConfig::setConfig($cfg['url_builder']);
  • Are there any other errors in contenido logs?
regards Ortwin
ConLite 3.0.0-dev, alternatives und stabiles Update von Contenido 4.8.x unter PHP 8.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Re: Redirect

Beitrag von ilias »

dear oldperl

i check everything that you said:
1-step : i have the folders
2-step: The entries at the end of contenido/includes/startup.php existe
3-step: no error logs

Anything else for help???

Thanks everybody for answering in my problem

Best Regards
ilias
Oldperl
Beiträge: 4316
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Hat sich bedankt: 6 Mal
Danksagung erhalten: 4 Mal
Kontaktdaten:

Re: Redirect

Beitrag von Oldperl »

Hello ilias,

ok, let's try if the class exists. Try the following, change the code in front_content.php near line 200 like this

Code: Alles auswählen

print "Class ".(class_exists(Contenido_Url))?"exists":"does not exist";
// update urlbuilder set http base path 
Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);
Now call the front_content.php in your browser and check what is printed out.

regards Ortwin
ConLite 3.0.0-dev, alternatives und stabiles Update von Contenido 4.8.x unter PHP 8.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Re: Redirect

Beitrag von ilias »

Dear Oldperl

i put the code as you told me (show it below)

Code: Alles auswählen

// Initialize client
if (!isset($client)) {
    //load_client defined in frontend/config.php
    $client = $load_client;
}

print "Class ".(class_exists(Contenido_Url))?"exists":"does not exist";
// update urlbuilder set http base path
Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);

// Initialize language
if (!isset($lang)) { 

But it show the below error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/web46/html/contenido-neu/psb/front_content.php on line 203

For your information the directory that exists the client is /psb
thepoet
Beiträge: 55
Registriert: Mo 7. Jul 2003, 11:39
Wohnort: Vilsbiburg
Kontaktdaten:

Re: Redirect

Beitrag von thepoet »

Please modify the code like the following:

Code: Alles auswählen

// Initialize client
if (!isset($client)) {
    //load_client defined in frontend/config.php
    $client = $load_client;
}

// update urlbuilder set http base path
$inst = Contenido_Url::getInstance();
$builder = $inst->getUrlBuilder();
$builder->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);

// Initialize language
if (!isset($lang)) { 
and if the error persists, this should show which of the method calls exactly triggers the error. Though I'm still rather convinced that, from the error message you get, your php version is 4.x. Could it be that you're running different versions as php-cli (command line) interpreter and in your webserver?
ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Re: Redirect

Beitrag von ilias »

dear thepoet
i made the changes and now it shows:

Parse error: syntax error, unexpected '/' in /var/www/web46/html/contenido-neu/psb/front_content.php on line 195

that means //initialize client

can it solve??
thepoet
Beiträge: 55
Registriert: Mo 7. Jul 2003, 11:39
Wohnort: Vilsbiburg
Kontaktdaten:

Re: Redirect

Beitrag von thepoet »

Looks like an error (maybe a new one introduced when changing the file) in a line before 195. Check if the code line above it is missing the closing semicolon.
ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Re: Redirect

Beitrag von ilias »

Ok my friends,
in attach file you'll see all the code of the front_content.
May be you;ll see somtehing that i cannot find.
Dateianhänge
front_content.rar
front_content
(8.75 KiB) 127-mal heruntergeladen
Dodger77
Beiträge: 3626
Registriert: Di 12. Okt 2004, 20:00
Wohnort: Voerde (Niederrhein)
Kontaktdaten:

Re: Redirect

Beitrag von Dodger77 »

Code: Alles auswählen

/ Initialize client
is the problematic line. The following would be better:

Code: Alles auswählen

// Initialize client
ilias
Beiträge: 90
Registriert: Di 13. Nov 2007, 11:49
Wohnort: Greece
Kontaktdaten:

Re: Redirect

Beitrag von ilias »

Yes, you are right
but now it has new mistake in:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/web46/html/contenido-neu/psb/front_content.php on line 297

that means

Code: Alles auswählen

// error page
$aParams = array (
    'client' => $client, 'idcat' => $errsite_idcat[$client], 'idart' => $errsite_idart[$client], 
    'lang' => $lang, 'error'=> '1'
);
$errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
and special

Code: Alles auswählen

$errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
Thanks in advance and for your quick reply to solve my problem

Best Regards
Ilias
ImmoF
Beiträge: 175
Registriert: Do 26. Jun 2003, 18:33
Kontaktdaten:

Re: Redirect

Beitrag von ImmoF »

Ich beschaeftige mich zur Zeit mit dieser Installation, insofern will ich mich mal mit meiner Muttersprache zu Wort melden, vielleicht schaffen wir dann irgendwie eine Loesung. Ich stehe vor einem voelligen Raetsel.

Das Contenido wurde urspruenglich auf domain.de installiert. Dann wurden Mandanten eingerichtet und weitere Domains auf das Verzeichnis gelegt. Ein Mandant liegt im Ordner /psb/

Der Aufruf bringt keinen Fehler:

domain.de/psb/

Nehme ich jedoch die 2. Domain

domain2.de

kommt der Fehler

Code: Alles auswählen

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/web46/html/contenido-neu/psb/front_content.php on line 203 
Die Domain domain2.de liegt auf dem Mandantenverzeichnis und es wird sauber auf die front_content.php weitergeleitet.

Der Server nutzt PHP5.

Ich wuerde einen Fehler im Code ausschliessen, da ja der 1. Abruf fehlerlos arbeitet. Offenbar kann die neue Domain nicht verarbeitet werden. con_code und con_inuse wurden bereits geleert. Die Mandanteneinstellungen sind angepasst.

Je oefter ich drueber nachdenke, um so mehr denke ich, dass es die griechische Sprache des Mandanten sein koennte (anderer Zeichensatz). Aber dann muesste bei beiden Domains der Fehler auftreten, oder?
Dodger77
Beiträge: 3626
Registriert: Di 12. Okt 2004, 20:00
Wohnort: Voerde (Niederrhein)
Kontaktdaten:

Re: Redirect

Beitrag von Dodger77 »

Da es sich um zwei verschiedene Domains handelt, können auch unterschiedliche PHP-Versionen im Einsatz sein. Vielleicht kann das mal überprüft werden, indem im Mandantenverzeichnis eine Datei "config.local.php" abgelegt wird mit folgendem Inhalt:

Code: Alles auswählen

<?php

echo PHP_VERSION;

?>
Gesperrt