pdf-l4
pdf-l4 copied to clipboard
Constants may only evaluate to scalar values
ErrorException
Constants may only evaluate to scalar values open: /var/sites/exactchange/vendor/thujohn/pdf/src/Thujohn/Pdf/Pdf.php
protected $orientation;
public function __construct(){
$_conf = array('DOMPDF_TEMP_DIR', 'DOMPDF_UNICODE_ENABLED', 'DOMPDF_PDF_BACKEND', 'DOMPDF_DEFAULT_MEDIA_TYPE', 'DOMPDF_DEFAULT_PAPER_SIZE', 'DOMPDF_DEFAULT_FONT', 'DOMPDF_DPI', 'DOMPDF_ENABLE_PHP', 'DOMPDF_ENABLE_REMOTE', 'DOMPDF_ENABLE_CSS_FLOAT', 'DOMPDF_ENABLE_JAVASCRIPT', 'DEBUGPNG', 'DEBUGKEEPTEMP', 'DEBUGCSS', 'DEBUG_LAYOUT', 'DEBUG_LAYOUT_LINES', 'DEBUG_LAYOUT_BLOCKS', 'DEBUG_LAYOUT_INLINE', 'DOMPDF_FONT_HEIGHT_RATIO', 'DEBUG_LAYOUT_PADDINGBOX', 'DOMPDF_ENABLE_HTML5PARSER', 'DOMPDF_ENABLE_FONTSUBSETTING', 'DOMPDF_ADMIN_USERNAME', 'DOMPDF_ADMIN_PASSWORD');
foreach ($_conf as $conf){
if ((Config::has('pdf::'.$conf) || Config::get('pdf::'.$conf)) && !defined($conf))
define($conf, Config::get('pdf::'.$conf));
}
What value did you change in the config ?
Nothing, just installed on my laravel project with composer
I have this problem too, exactly same. But there is no problem for the WAMP. Any solution here? because of i using share host ?
My php version is 5.4.29
I noticed this happened to me after installing with composer, but forgetting to add Thujohn\Pdf\PdfServiceProvider
to the list of providers in app/config/app.php
.
This happens as since Laravel doesn't have access to the config values, it returns an empty array which it attempts to define.