Closed edukmattos closed 8 years ago
Podemos conversar em português ?
corrigindo... existe dois "_" antes e depois do DIR pois nao aparecem quando envio.
Opa, então qual a dúvida?
Oi ! Surge o erro abaixo quando eu rodo no servidor compartilhado (GoDaddy). Quando rodo localmente, funciona beleza.
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) HELP syntax error, unexpected '.', expecting ',' or ';'
/home/spmtec/public_html/siscad.aafc/vendor/lavela/phpjasper/src/JasperPHP/JasperPHP.php
Oi ! Alguma sugestão da causa do erro ? Quando executo localmente, funciona beleza. Quando via web, não.
Será problema de versão do php ? PHP version localhost: 5.6.11 PHP version www: 5.5
Olá ecmattos, você pode me descrever em qual linha ocorre o erro no JasperPHP.php ?
8
Na declaração deixe apenas assim
protected $path_executable;
E no construtor coloque da seguinte maneira.
function __construct($resource_dir = false)
{
$this->path_executable .= __DIR__ . '/../JasperStarter/bin/';
//Restante do código
}
So para confirmar...
Mudo isto:
class JasperPHP { protected $executable = 'jasperstarter'; //executable jasperstarter protected $path_executable = DIR . '/../JasperStarter/bin/'; //Path to executable protected $the_command; protected $redirect_output; protected $background; protected $windows = false;
protected $formats = array('pdf', 'rtf', 'xls', 'xlsx', 'docx', 'odt', 'ods', 'pptx', 'csv', 'html', 'xhtml', 'xml', 'jrprint');
protected $resource_directory; //Path to report resource dir or jar file
function __construct($resource_dir = false)
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
$this->windows = true;
if (!$resource_dir) {
$this->resource_directory = __DIR__ . '/../../../vendor/cossou/jasperphp/src/JasperStarter/bin';
} else {
if (!file_exists($resource_dir))
throw new \Exception('Invalid resource directory.', 1);
$this->resource_directory = $resource_dir;
}
}
Para isto:
class JasperPHP { protected $executable = 'jasperstarter'; //executable jasperstarter protected $path_executable;<<<<<<<<<<<<<<<<<<<<<< protected $the_command; protected $redirect_output; protected $background; protected $windows = false;
protected $formats = array('pdf', 'rtf', 'xls', 'xlsx', 'docx', 'odt', 'ods', 'pptx', 'csv', 'html', 'xhtml', 'xml', 'jrprint');
protected $resource_directory; //Path to report resource dir or jar file
function __construct($resource_dir = false)
{
$this->path_executable .= __DIR__ . '/../JasperStarter/bin/'; <<<<<<<<<<
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
$this->windows = true;
if (!$resource_dir) {
$this->resource_directory = __DIR__ . '/../../../vendor/cossou/jasperphp/src/JasperStarter/bin';
} else {
if (!file_exists($resource_dir))
throw new \Exception('Invalid resource directory.', 1);
$this->resource_directory = $resource_dir;
}
}
Isso mesmo ecmattos.
Hi !
When I run locally there are no problems but when I run the web server via cpanel (Godaddy), displays the error on line 8 below.
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) HELP syntax error, unexpected '.', expecting ',' or ';'
/home/spmtec/public_html/siscad.aafc/vendor/lavela/phpjasper/src/JasperPHP/JasperPHP.php
<?php namespace JasperPHP; class JasperPHP { protected $executable = "jasperstarter"; //executable jasperstarter
Im using: PHP version localhost: 5.6.11 PHP version www: 5.5