Comments (3)
I also tried investigating the "Cpdf.php" file the error log was pointing to. I made my way to the specific line thinking there may be another setting equivelant to "set_max_timeout" that could be changed but unfortunately that doesn't seem to be the case. This section appears to be about styling.
I did read in one of the other posts someone asked about fonts, but I only have the standard fonts that come with Ubuntu and haven't made any changes.
From the error log it seems it always terminates around line 5748, which I take to mean that is about as far as the process is able to get before the 30 second timer runs out and it is forced to terminate. It seems to me if it respected the extended time limit it would complete as it is near the end already. It appears to be functioning but just keeps getting killed before it can complete.
I may need to resubmit this as a bug?
See this screenshot of Cpdf.php with the cursor at line 5,748:
from bookstack.
I SOLVED IT!
So as it turns out, there are multiple php.ini files. I was editing the php.ini file located in:
/etc/php/8.1/cli/php.ini
However the standard install of BookStack, at least for me, is Apache, which has it's own copy. So to solve the issue, I had to go into:
/etc/php/8.1/apache2/php.ini
Once I edited the php.ini file in the apache2 folder and restarted, it worked. When clicking on "export" and then ".pdf file", BookStack will open a new blank tab and it will hang there. In my instance, my book with several hundred pages and easily as many images took just over two minutes to complete, well beyond the default 30 second limit. Once it's complete it downloads via your browser. In my instance I've yet to setup HTTPS so I received a warning that it was insecure, but since I know where it's coming from I accepted and the .pdf downloaded and displays as normal.
Here's some troubleshooting steps for anyone else who receives either the "unknown error" or "maximum execution time of 30 seconds exceeded" when trying to export in future:
-
You need to know or find out what web server you're running as this will determine where the .php.ini file is. If you're having trouble getting the full name exactly correct, make sure you have installed ubuntu with the graphical user interface, click "files" from the desktop, click "other locations" and then "computer". This will get you to the very top of your directory or the equivalent of C: in windows. I don't know why Linux doesn't bring you here by default.
-
Once you're at the top of your directory, you can navigate/drill down and explore. First check /etc/php/((YOUR_VERSION))/ and theoretically your webserver should have a folder in here.
-
Now that you have the name for your web servers folder, open a terminal and navigate to it using the cd command. For this command I'll use apache2 as that seems to be the current default for Ubuntu, but replace "apache2" with the folder for your web server if necessary. I'm also running php 8.1 but replace as necessary for your version. Your command should look like
cd /etc/php/((YOUR_PHP_VERSION))/((YOUR_WEB_SERVER))
In my case
cd /etc/php/8.1/apache2
-
This should have changed your terminal so you see /etc/php/8.1/apache2 to the left of your cursor. From here we'll use Linuxs' built in command line text editor (nano) to edit the file. We're also going to need to run this with super user/root permissions or we won't be able to save the file so you'll need an administrator password. Run this command:
sudo nano php.ini
-
Enter your admin/root/account password and it should open a colourful window. From here we want to scroll all the way down using the arrow keys until we bump into RESOURCE LIMITS. Just below this you should see the line "max_execution_time = 30". We want to increase this. I set mine to 3000 which is 50 minutes but you set it to whatever you like.
-
Next, a few more lines down you should see "memory limit = 128M". You'll want to increase this as well, how much depends on how many resources your server has available. I provisioned (built) my server with 8GB of RAM so I just quadrupled the amount to 512 megabytes. You'll want the values to look like this:
-
Once the values have been updated, you need to press "CTRL + X" to exit. You'll be asked if you want to save. Press "y". You'll then be asked what you want to name the file. It should be autofilled with "php.ini" already so just hit enter. If you have sufficient permissions, that should be it and you'll be back at the command line. Otherwise you'll receive an error stating you don't have permission.
-
Once this is done, restart your server. I just restarted ubuntu completely and it worked. If you can't or don't want to restart the server there are ways to restart webservers via the command line. In my case with apache, I used the command:
/etc/init.d/apache2 restart
-
Once your server is back up, go back to your BookStack instance and try the export again. Remember it will give you a blank page and probably sit there for a long time but just let it do it's thing.
Hopefully that's helped you out. Good luck!
from bookstack.
Happy to hear you found the solution to your issue @YID-C, and thanks for sharing your resolution steps.
I'll therefore close this off.
from bookstack.
Related Issues (20)
- After upgrading from 23.x to 24.x, headers are not showing properly HOT 2
- Rate limit on password resets HOT 9
- migrate to 24.05 fails with "Class "Barryvdh\DomPDF\ServiceProvider" not found" HOT 4
- Attachment upload validation error message appears are shown as JSON
- PLEASE DELETE BUG - I found the problem
- bug in documentation - /dev/docs /visual-theme-system.md & corresponding YouTube video HOT 1
- php artisan cache:clear Make sure you have the appropriate permissions HOT 9
- Users are not shown any templates HOT 7
- Not Found error on /login URL HOT 9
- After version 24.02, comments on pages cannot add image content
- Suddenly get a 500 errors HOT 4
- Request for Comment: Process & scope for security announcements & CVEs HOT 7
- Wrong notification preferences URL in email HOT 2
- OIDC login with Authelia fails with v24.05 HOT 6
- Have a non-blank screen while exports run.
- Webhooks "send" based on book or shelf HOT 1
- Template Append to page content not working HOT 3
- Update custom alignment handing to also clean table `align` attributes
- Scheduled page publishing HOT 4
- Tiered permissions - Managers can promote employees to managers, but not to admins. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bookstack.