0

My Joomla system reports this error:

syntax error, unexpected 'new' (T_NEW)

It does not report the line and file where the PHP error is generated.

in my configuraton.php file I have:

public $error_reporting = 'maximum';

I can't understand why this behavior, Can anyone help me? Why does he show me the error without the relevant line and the relative file that generates it? looking on the internet I found no help of any kind :(

EDIT: error.log reporting

[Mon Feb 11 15:05:34.552788 2019] [proxy_fcgi:error] [pid 31779] [client 213.152.xx.xx:65409] AH01071: Got error '/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(/var/www/clients/client1/web20/web/templates/system/html/modules.php): failed to open stream: No such file or directory in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\nPHP message: PHP Warning: include_once(): Failed opening '/var/www/clients/client1/web20/web/templates/system/html/modules.php' for inclusion (include_path='/var/www/clients/client1/web20/web/plugins/system/shlib/shl_packages//ZendFramework-1.11.7-minimal/library:.:/usr/share/php') in /var/www/clients/client1/web20/web/libraries/src/Helper/ModuleHelper.php on line 212\n'

--------------- EDIT 2 ----------------

I have found what generates my error without reference.. In back-end, I see that includes a php file, within this I have the following code:

<?php 
require_once("pw/init.php");

$hotelId = "1";
$lang = Util::getLang();
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : "default";
$selectedOffer = isset($_REQUEST['selectedOffer'])?$_REQUEST['selectedOffer']:"---"; 

$redir = Config::$confirmPage[$lang];

FormInformationRequestResponsive::show($hotelId, $redir, $type, $selectedOffer);

commenting on the last line the error disappear... Into the FormInformationRequestResponsive class, I do not understand what generates the error, I do not find new empty or repeated...

class FormInformationRequestResponsive extends Form {
    // pagina di ringraziamento
    static $redir = '/index.php?option=com_content&view=article&id=89&Itemid=337';

    public static function show($hotelId = "", $redir = "", $type ="",$selectedOffer=""){

        $hotels = false;
        $hasHotel = false;
        $hasResidence = false;

        $lang = Util::getLang();

        //load active offers list
        //$activeOffers = Util::getActiveOffers($lang);

        if(is_numeric($hotelId)){
            $hasResidence = Util::isResidence($hotelId);
            $hasHotel = Util::isHotel($hotelId);

            if($hasResidence){
                $treatmentsRes = Util::getResidenceTreatments($hotelId);
            }
            if($hasHotel){
                $treatmentsHot = Util::getHotelTreatments($hotelId);
            }
        }else{
            throw new Exception ("errore - id hotel non trovato");
        }

        $template = Util::getTemplate();      

        Util::addScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js");
        Util::addScript("/pw/js/formInformationRequest.js.php");
        Util::addStyleSheet('https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css', 'text/css');

        if(file_exists(dirname(__FILE__)."/../js/i18n/jquery.ui.datepicker-$lang.js"))
            Util::addScript("/pw/js/i18n/jquery.ui.datepicker-$lang.js" );
        Util::addStyleSheet('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css', 'text/css');
        Util::addStyleSheet('/pw/css/informationRequestResponsive.css?v=1', 'text/css');


        $get = "";
        $arr = Util::getRequestVar('datefrom');
        if($arr)
            $get .= '&f='.$arr;

        $par = Util::getRequestVar('dateto');
        if($par)
            $get .= '&t='.$par;

        $par = Util::getRequestVar('adulti');
        if($par)
            $get .= '&a='.$par;

        $par = Util::getRequestVar('camere');
        if($par)
            $get .= '&c='.$par;


        Util::addScript("/pw/js/pw.js.php?lang=$lang".$get );

        global $p_tracer;

        if(!isset($p_tracer))
            require_once ( dirname(__FILE__).'/pensaretracer/PensareTracer.class.php' );


        $translator=new Translator($lang);

        switch ($type) {

            default:
                require_once(dirname(__FILE__)."/../html/informationRequestResponsive.php");
            break;
        }

        $translator->obGetContent();
        $html=$translator->showTranslated();


        // $fp = fopen('debug.txt', 'a');
        // fwrite($fp, print_r($html, true));
        // fclose($fp);

        echo $html;
    }

The error is generated by Util class, but testing various ways to eliminate the error, I can not find one working

  • Joomla 3.9? What file were you editing just before the error? You just forgot to close ‘;’ a line there, or a variable is given in a wrong format (without $) or something of that sort, most probably; – Zollie Feb 11 at 14:50
  • It sounds like one of the files is trying to call a class incorrectly. Please check your server logs and this will most likely give you more info as to where the error is coming from – Lodder Feb 11 at 14:51
  • @Zollie I was passed the problem because it marked an error in connection to the db, I updated the deprecated functions of php 5.4 to php 7.0 for the connection, fixed that problem was born this.. – FABBRj Feb 11 at 14:58
  • @Lodder ♦ checking the error logs I get back some module inclusion warnings, I corrected them but the behavior does not change – FABBRj Feb 11 at 15:00
  • Copy the warning into your question and we can see more info on this... – Zollie Feb 11 at 15:03

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.