Answer the question
In order to leave comments, you need to log in
How to fix open_basedir error when generating XSL document (using PHPExcel)?
On the local environment, the document generation is normal. On the production server, after generating the document, I try to open it in Excel. A warning pops up "The format of the file 'example.xsl' does not match the file permission. The file may be corrupted or unsafe. Do you want to open the file?" After it opens, the following content is obtained inside:
clickable
As far as I understand, an error occurs during generation:
Warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/ekker/data:.) in
<?php
require_once 'src/vendor/PHPExcel/PHPExcel.php';
require_once 'src/vendor/PHPExcel/PHPExcel/Writer/Excel5.php';
date_default_timezone_set('Asia/Vladivostok');
$xls = new PHPExcel();
$rows = 15;
$xls->setActiveSheetIndex(0);
$sheet = $xls->getActiveSheet();
$sheet->setTitle('Consulting');
$filename = "result.xls";
header ( "Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT" );
header ( "Cache-Control: no-cache, must-revalidate" );
header ( "Pragma: no-cache" );
header ( "Content-type: application/vnd.ms-excel;" );
header ( "Content-Disposition: attachment; filename=" . $filename );
$objWriter = new PHPExcel_Writer_Excel5($xls);
$objWriter->save('php://output');
Answer the question
In order to leave comments, you need to log in
Solved the problem in a different way.
In ispmanager, the user was given permission to use PHP as CGI.
Next, in the "www domains" select the desired domain, click change and select the item "PHP as CGI"
Then everything worked .. though in my case, it was also necessary to insert the function at the beginning of the script
:
stackoverflow.com/questions/1846882/open-basedir-r...
Your path to /tmp is forbidden and php cannot create a temporary file.
Tutorial on how to make a particle system on Canvas.
Approximately similar effect (again on particles) with the source code.
It's done on Canvas. You need to contact those who are friends with him. I don't even know how else to say it.
These libraries are used there: www.google-analytics.com/analytics.js and www.giantstepsmedias.com/assets/js/lib/modern-dete... . Animation takes place in canvas.
In general, this animation reminds me of an old joke on action-script'e, where you need to click "ok", and he runs away from you. Here the algorithm is as follows:
1) a bunch of different elements line up in their order (in this case, the letter "N") and randomly move in a small range (from which you can't exit until the "mouse" appears)
2) the mouse coordinates are read and the range is set ( here it is circular)
3) as soon as the element falls into the "large range" (mouse range) - its "small range" (d., in which it moves randomly) is shifted so
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question