php-fpm error helpers.php on line 233 #636

Closed
opened 2026-02-04 21:32:46 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @whynotlinux on GitHub (Apr 11, 2018).

For Bug Reports

  • BookStack Version : v0.20.3
  • PHP Version: PHP 7.0.27-0+deb9u1
  • MySQL Version: 10.1.26-MariaDB-0+deb9u1
Current Behavior

When I'm going to the home page of BookStack I have an error 500 from my nginx server.
My nginx and php-fpm work fine

This is the back trace:
#################
2018/04/10 22:23:44 [error] 6173#6173: *36 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '?' in /BookStack/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233" while reading response header from upstream, client: 83.193.191.111, server: doc.mydomain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9005", host: "doc.mydomain.com"
#################

and my nginx config

#################
server {
listen mypublicip:443;
server_name doc.mydomain.com;
root /doc.mydomain/public_html/BookStack/public;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/doc.mydomain.com.log combined;
access_log /var/log/nginx/domains/doc.mydomain.com.bytes bytes;
error_log /var/log/nginx/domains/doc.mydomain.error.log error;

ssl         on;
ssl_certificate      /conf/web/ssl.doc.mydomain.pem;
ssl_certificate_key  /conf/web/ssl.doc.mydomain.key;

location / {

    try_files $uri $uri/ /index.php?$query_string;
    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
        expires     max;

    }

    location ~ [^/]\.php(/|$) {
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        if (!-f $document_root$fastcgi_script_name) {
            return  404;
        }

        fastcgi_pass    127.0.0.1:9005;
        #fastcgi_index   index.php;
        include         /etc/nginx/fastcgi_params;
    }
}

#################

Could you help me?

Regards

Originally created by @whynotlinux on GitHub (Apr 11, 2018). ### For Bug Reports * BookStack Version : v0.20.3 * PHP Version: PHP 7.0.27-0+deb9u1 * MySQL Version: 10.1.26-MariaDB-0+deb9u1 ##### Current Behavior When I'm going to the home page of BookStack I have an error 500 from my nginx server. My nginx and php-fpm work fine This is the back trace: ################# 2018/04/10 22:23:44 [error] 6173#6173: *36 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '?' in /BookStack/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233" while reading response header from upstream, client: 83.193.191.111, server: doc.mydomain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9005", host: "doc.mydomain.com" ################# and my nginx config ################# server { listen mypublicip:443; server_name doc.mydomain.com; root /doc.mydomain/public_html/BookStack/public; index index.php index.html index.htm; access_log /var/log/nginx/domains/doc.mydomain.com.log combined; access_log /var/log/nginx/domains/doc.mydomain.com.bytes bytes; error_log /var/log/nginx/domains/doc.mydomain.error.log error; ssl on; ssl_certificate /conf/web/ssl.doc.mydomain.pem; ssl_certificate_key /conf/web/ssl.doc.mydomain.key; location / { try_files $uri $uri/ /index.php?$query_string; location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { expires max; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass 127.0.0.1:9005; #fastcgi_index index.php; include /etc/nginx/fastcgi_params; } } ################# Could you help me? Regards
Author
Owner

@lommes commented on GitHub (Apr 13, 2018):

That's strange since the ?? operator was introduced in PHP 7, so this should not be a problem.

Can you place a php file in the public folder with the following content, open it in a browser and post the result?

<?php
phpinfo();
?>

Just to make sure your webserver uses the correct php version.

@lommes commented on GitHub (Apr 13, 2018): That's strange since the ?? operator was introduced in PHP 7, so this should not be a problem. Can you place a php file in the public folder with the following content, open it in a browser and post the result? ``` <?php phpinfo(); ?> ``` Just to make sure your webserver uses the correct php version.
Author
Owner

@whynotlinux commented on GitHub (Apr 13, 2018):

Indeed I was using php 5.6 instead of php 7 now it's works

thank's a lot

@whynotlinux commented on GitHub (Apr 13, 2018): Indeed I was using php 5.6 instead of php 7 now it's works thank's a lot
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#636