Closed oren closed 3 years ago
The documentation is not proper. You need a local config.
You've changed the contents of config.php and thus made the class not exist.
Please reset your git head hard
git reset --hard
Then copy the local.config.php
from the examples directory to the root directory and generate again.
The documentation is not proper. You need a local config.
Sorry about that - I could have sworn I tested this 🤦♂️ I've fixed it in https://github.com/klimeryk/recalendar/commit/f24c0066b353f9d405f97b70be23612d50cedd7e
@oren, make sure you pull the newest version using git pull
in the folder (or redownload the ZIP archive).
i create a config.php
To make sure we're on the same page: you should not modify config.php
directly. Instead, create a new local.config.php
(in the same folder). You can copy one from the example folder as a starting point. Hope that helps!
git reset --hard
git pull
cp example/local.config.php .
php generate.php
PHP Fatal error: Uncaught Mpdf\MpdfException: mbstring extension must be loaded in order to run mPDF in /home/oren/p/recalendar/vendor/mpdf/mpdf/src/Mpdf.php:9628
Stack trace:
#0 /home/oren/p/recalendar/vendor/mpdf/mpdf/src/Mpdf.php(1031): Mpdf\Mpdf->_dochecks()
#1 /home/oren/p/recalendar/generate.php(54): Mpdf\Mpdf->__construct()
#2 {main}
thrown in /home/oren/p/recalendar/vendor/mpdf/mpdf/src/Mpdf.php on line 9628
Ah, now it's more clear :) As the message implies - mPDF (the library I'm using to generate the PDFs) requires the mbstring
extension to be installed and enabled. I assumed that's default on new installations, but apparently not? I'll add it to the README file (done in https://github.com/klimeryk/recalendar/commit/974df256cc5f449f05b6ade3ebcf3af0dd001879).
You can run php -i
and check if you have a mbstring
section.
This is how it looks like on my system:
mbstring
Multibyte Support => enabled
Multibyte string engine => libmbfl
HTTP input encoding translation => disabled
libmbfl version => 1.3.2
Unfortunately, how to install and enable this extension (and, apparently, also gd
) depends on your configuration and operating system. As usual, a quick internet search should give some answers :) Hope this helps!
I am on ubuntu 20.10. I had to run sudo apt install php7.4-mbstring
Thanks for the help. You might want to add to the readme this line: cp example/local.config.php.
so others can just copy paste from the readme.
Thanks for the follow-up and documenting the step needed on Ubuntu - might come in handy for someone else encountering the same issue and searching for it 🙇
You might want to add to the readme this line: cp example/local.config.php. so others can just copy paste from the readme.
Good idea! I've added it in https://github.com/klimeryk/recalendar/commit/43351381fb86dbce83bb855825a934a78b7fb195
I fix it with
composer install --ignore-platform-reqs
i create a config.php
and i run this command: