一、安装流程
- 获取源码
git clone https://github.com/jdorn/php-reports.gitcd php-reports- 安装依赖(需已安装Composer)
composer install --no-dev- 生成配置文件
# Linux / macOScp config/config.php.sample config/config.php# Windows 用 copy 命令copy config\config.php.sample config\config.php- 修改配置文件数据库部分
'environments' => array( 'main'=>array( // Supports AdoDB connections 'ado'=>array( 'uri'=>'mysql://username:password@host:3306/dbname' ), // Supports and PDO database 'pdo'=>array( 'dsn'=>'mysql:host=127.0.0.1;port=3306;dbname=dbname', 'user'=>'root', 'pass'=>'root', ), // Supports MongoDB 'mongo'=>array( 'host'=>'127.0.0.1', 'port'=>'3306' ), ), ),- 给缓存目录写权限
chmod -R 777 cache- 在Nginx网站配置文件中,添加一段 :
try_files $uri $uri/ /index.php?$query_string; 位置如下:
server { listen 80; server_name reports.local; root /var/www/php-reports/public; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; }}- mongodb拓展开启:在php.ini中添加一行
extension=mongodb- 解决报表内容中文乱码
编辑源码文件:PHP-Reports\lib\PhpReports\ReportValue.php 位置在72行左右
源代码:
return utf8_encode($value);修改为:
return $value;
打赏
如果觉得文章对您有用,请随意打赏。
您的支持是我们继续创作的动力!
微信扫一扫
支付宝扫一扫

评论一下?