BookStack Manual Install not work in PHP 7.4.4 #1630

Closed
opened 2026-02-05 01:28:03 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @tomasdelvechio on GitHub (Apr 7, 2020).

Describe the bug
When I try to open the start page, I get this error in apache2 error.log file:

[Tue Apr 07 09:33:02.907781 2020] [:error] [pid 30522] [client 127.0.0.1:34236] PHP Fatal error:  Default value for parameters
with a class type hint can only be NULL in /home/data/workspace/BookStack/app/helpers.php on line 15
[Tue Apr 07 09:33:19.311376 2020] [:error] [pid 30524] [client 127.0.0.1:34238] PHP Fatal error:  Default value for parameters
with a class type hint can only be NULL in /home/data/workspace/BookStack/app/helpers.php on line 15
[Tue Apr 07 09:34:16.490474 2020] [:error] [pid 30525] [client 127.0.0.1:34240] PHP Fatal error:  Default value for parameters
with a class type hint can only be NULL in /home/data/workspace/BookStack/app/helpers.php on line 15

and I get a blank page.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.28.3
  • PHP Version: 7.4.4
  • Hosting Method (Nginx/Apache/Docker): Apache

Additional context
The installation is new.

Originally created by @tomasdelvechio on GitHub (Apr 7, 2020). **Describe the bug** When I try to open the start page, I get this error in apache2 error.log file: ```log [Tue Apr 07 09:33:02.907781 2020] [:error] [pid 30522] [client 127.0.0.1:34236] PHP Fatal error: Default value for parameters with a class type hint can only be NULL in /home/data/workspace/BookStack/app/helpers.php on line 15 [Tue Apr 07 09:33:19.311376 2020] [:error] [pid 30524] [client 127.0.0.1:34238] PHP Fatal error: Default value for parameters with a class type hint can only be NULL in /home/data/workspace/BookStack/app/helpers.php on line 15 [Tue Apr 07 09:34:16.490474 2020] [:error] [pid 30525] [client 127.0.0.1:34240] PHP Fatal error: Default value for parameters with a class type hint can only be NULL in /home/data/workspace/BookStack/app/helpers.php on line 15 ``` and I get a blank page. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.28.3 - PHP Version: 7.4.4 - Hosting Method (Nginx/Apache/Docker): Apache **Additional context** The installation is new.
Author
Owner

@ssddanbrown commented on GitHub (Apr 7, 2020):

Hi @tomasdelvechio,
Sorry to hear you are experiencing issues.

That's a very odd error message for the reported line of code.
Can you run the below command and paste the output here please?

head -n 25 /home/data/workspace/BookStack/app/helpers.php

Also, Could you confirm what operating system you're running BookStack on and the installation method you used?

@ssddanbrown commented on GitHub (Apr 7, 2020): Hi @tomasdelvechio, Sorry to hear you are experiencing issues. That's a very odd error message for the reported line of code. Can you run the below command and paste the output here please? ```shell head -n 25 /home/data/workspace/BookStack/app/helpers.php ``` Also, Could you confirm what operating system you're running BookStack on and the installation method you used?
Author
Owner

@tomasdelvechio commented on GitHub (Apr 7, 2020):

Thanks @ssddanbrown !!

The head command return this:

<?php

use BookStack\Auth\Permissions\PermissionService;
use BookStack\Auth\User;
use BookStack\Ownable;
use BookStack\Settings\SettingService;

/**
 * Get the path to a versioned file.
 *
 * @param  string $file
 * @return string
 * @throws Exception
 */
function versioned_asset(string $file = ''): string
{
    static $version = null;

    if (is_null($version)) {
        $versionFile = base_path('version');
        $version = trim(file_get_contents($versionFile));
    }

    $additional = '';
    if (config('app.env') === 'development') {

I installed BookStack in Ubuntu 18.04.4 LTS, and I use the manual method.

@tomasdelvechio commented on GitHub (Apr 7, 2020): Thanks @ssddanbrown !! The head command return this: ```php <?php use BookStack\Auth\Permissions\PermissionService; use BookStack\Auth\User; use BookStack\Ownable; use BookStack\Settings\SettingService; /** * Get the path to a versioned file. * * @param string $file * @return string * @throws Exception */ function versioned_asset(string $file = ''): string { static $version = null; if (is_null($version)) { $versionFile = base_path('version'); $version = trim(file_get_contents($versionFile)); } $additional = ''; if (config('app.env') === 'development') { ``` I installed BookStack in Ubuntu 18.04.4 LTS, and I use the [manual method](https://www.bookstackapp.com/docs/admin/installation/#manual).
Author
Owner

@ssddanbrown commented on GitHub (Apr 7, 2020):

@tomasdelvechio Thanks for posting, That all looks normal. I'd maybe expect that error message with a really old PHP version. How did you install php @tomasdelvechio? I did notice you're on php7.4 which is not the default that is provided on Ubuntu 18.04.

@ssddanbrown commented on GitHub (Apr 7, 2020): @tomasdelvechio Thanks for posting, That all looks normal. I'd maybe expect that error message with a really old PHP version. How did you install php @tomasdelvechio? I did notice you're on php7.4 which is not the default that is provided on Ubuntu 18.04.
Author
Owner

@tomasdelvechio commented on GitHub (Apr 7, 2020):

@tomasdelvechio Thanks for posting, That all looks normal. I'd maybe expect that error message with a really old PHP version. How did you install php @tomasdelvechio? I did notice you're on php7.4 which is not the default that is provided on Ubuntu 18.04.

Sorry, my mistake. I had load the php5.6 module in apache2. Thanks.

@tomasdelvechio commented on GitHub (Apr 7, 2020): > @tomasdelvechio Thanks for posting, That all looks normal. I'd maybe expect that error message with a really old PHP version. How did you install php @tomasdelvechio? I did notice you're on php7.4 which is not the default that is provided on Ubuntu 18.04. Sorry, my mistake. I had load the php5.6 module in apache2. Thanks.
Author
Owner

@ssddanbrown commented on GitHub (Apr 8, 2020):

Ah, That makes sense then. Will therefore close this.

@ssddanbrown commented on GitHub (Apr 8, 2020): Ah, That makes sense then. Will therefore close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1630