mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-05 00:29:48 +03:00
PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE) in aws/aws-sdk-php/src/functions.php on line 36 #731
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KyferEz on GitHub (Jun 27, 2018).
For Bug Reports
Expected Behavior
Use the configured PHP version for the site
Current Behavior
Uses default PHP version
Steps to Reproduce
Setup CentOS 7 Perfect server with ISPConfig using this guide: https://www.howtoforge.com/tutorial/perfect-server-centos-7-apache-mysql-php-pureftpd-postfix-dovecot-and-ispconfig/
Then install PHP7.1 using this guide: https://www.sunaryohadi.info/additional-php-versions-centos-7-nginx-ispconfig-3-gce.htm
Then create a site and set the site's PHP version to use 7.1
You will receive this error when trying to run "composer install":
PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE) in /var/www/clients/client1/web1/web/docs/vendor/aws/aws-sdk-php/src/functions.php on line 36
@lommes commented on GitHub (Jun 27, 2018):
Please verify the PHP version you are using on cli is 5.5+ unsing
php --version. This is the version composer tries to use and judging only by the error you posted this might still be 5.4.You may also try running
PATH=$PATH:/path/to/your/directory/with/php/7.1 composer installbut I think this will still fail due to some scripts in composer.json, but you should get past the package installation with that.
@KyferEz commented on GitHub (Jun 27, 2018):
The CLI version is 5.4. I do not want to attempt to change that as there is a chance it will break the server.
The path statement did not work. I still get the same error. I'm pretty sure the reason is that PHP7.1 is installed using the REMI repo, so the name to execute is php71, not php.
`PATH=$PATH:/usr/bin/php71 composer install
@lommes commented on GitHub (Jun 27, 2018):
BookStack needs a newer PHP version than 5.4 even in the cli part.
Since your php 7.1 binary is not named php the command fails because it still uses php 5.4
You can try to create a symlink to the 7.1 binary and use this one in the path command line:
In this case the last found php binary will be used by composer.
@KyferEz commented on GitHub (Jun 27, 2018):
Didn't work, got the same error. Apparently the assertion that the last found php binary to be found will be used is somehow incorrect. Here I show the path setting was applied, but it is still using wrong version:
[root@s02 docs]# PATH=$PATH:/tmp && echo $PATH && php -v
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/admin/.local/bin:/home/admin/bin:/tmp
PHP 5.4.16 (cli) (built: Apr 12 2018 19:02:01)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
@lommes commented on GitHub (Jun 27, 2018):
Ok, just checked. The first found executable in PATH is taken, so it should work if you change it to:
PATH=/tmp:$PATH@KyferEz commented on GitHub (Jun 27, 2018):
I had to also install php71-php-tidy from the REMI repo but once done it completed successfully! Thanks!
The rest of the install went without issue, however as I'm installing this to a site that has several things on the site (wordpress at site.com/, OTRS at site.com/otrs, and this at site.com/docs). So I can't alter the document root, as step 7 says, and I assume this is why I get a 403 error? Are there other options?
@lommes commented on GitHub (Jun 27, 2018):
BookStack should run fine if you symlink the public directory to some folder in your document root, see https://github.com/BookStackApp/BookStack/issues/291#issuecomment-276442469
You may need to add a rewrite base to the included htaccess file.
@KyferEz commented on GitHub (Jun 27, 2018):
Ok, so using that commend as a guide, I moved by BookStack folder and setup the synlink. It loads and works! YAAA! Thank you!
For posterity, and hopefully to help others, here's my config:
The Site's root path: /var/www/clients/client1/web1/web/
The Path to BookStack: /var/www/clients/client1/web1/web/BookStack
The symlink Used: cd /var/www/clients/client1/web1/web && ln -s BookStack/public docs
Also, I set the appurl in .env to: APP_URL=https://www.mysite.com/docs/
NOTE: In the APP_URL, the HTTP part needs to be either http or https depending upon your site settings. I was having trouble because I had the URL set as http when my site was auto-redirecting to https. I figured that out with Dev Tools; the non-loading CSS pages were showing a URL of http.