Closed flamechair closed 5 years ago
Hi @iamtpage, Sorry to hear you're having trouble installing BookStack on aarch64. Unfortunately I don't think I have any aarch64 devices to test this on unless you know of a good, easy to set-up, emulator.
The warnings and errors are very odd. Most of the Warning: Ambiguous class resolution
lines list two files that don't relate to eachother, It's almost like the contents of all the files has jumbled up in a consistent manner, Or the composer autoload index is off.
This error:
PHP Fatal error: Class 'BookStack\Model' not found in /var/www/html/bootstrap/init.php on line 5
There's not even anything on line 5 of bootstrap/init.php. What does the contents of that file like look on the faulty install? Would be good just to confirm the contents don't look different.
/var/www/html # ls -al
total 704
drwxr-xr-x 24 nginx www-data 4096 Mar 29 22:21 .
drwxr-xr-x 5 root root 4096 Mar 29 22:21 ..
-rw-r--r-- 1 nginx www-data 3039 Mar 29 22:21 .env
-rw-rw-rw- 1 nginx www-data 1177 Mar 29 21:46 LICENSE
drwxrwxrwx 26 nginx www-data 4096 Mar 29 22:21 app
-rwxrwxrwx 1 nginx www-data 1528 Mar 29 21:46 artisan
drwxrwxrwx 4 nginx www-data 4096 Mar 29 22:21 bootstrap
-rw-rw-rw- 1 nginx www-data 3166 Mar 29 21:46 composer.json
-rw-rw-rw- 1 nginx www-data 226368 Mar 29 21:46 composer.lock
drwxrwxrwx 2 nginx www-data 4096 Mar 29 22:21 config
drwxrwxrwx 8 nginx www-data 4096 Mar 29 22:21 database
-rw-rw-rw- 1 nginx www-data 382124 Mar 29 21:46 package-lock.json
-rw-rw-rw- 1 nginx www-data 1392 Mar 29 21:46 package.json
-rw-rw-rw- 1 nginx www-data 251 Mar 29 21:46 phpcs.xml
-rw-rw-rw- 1 nginx www-data 2018 Mar 29 21:46 phpunit.xml
drwxrwxrwx 8 nginx www-data 4096 Mar 29 22:21 public
-rw-rw-rw- 1 nginx www-data 10205 Mar 29 21:46 readme.md
drwxrwxrwx 8 nginx www-data 4096 Mar 29 22:21 resources
drwxrwxrwx 2 nginx www-data 4096 Mar 29 21:46 routes
-rw-rw-rw- 1 nginx www-data 567 Mar 29 21:46 server.php
drwxrwxrwx 12 nginx www-data 4096 Mar 29 22:21 storage
drwxrwxrwx 12 nginx www-data 4096 Mar 29 22:21 tests
drwxrwxrwx 2 nginx www-data 4096 Mar 29 21:46 themes
drwxr-xr-x 96 nginx www-data 4096 Mar 29 22:21 vendor
-rw-rw-rw- 1 nginx www-data 8 Mar 29 21:46 version
-rw-rw-rw- 1 nginx www-data 2227 Mar 29 21:46 webpack.config.js
/var/www/html/bootstrap # cat init.php
<?php namespace BookStack;
use BookStack\Auth\User;
abstract class Ownable extends Model
{
/**
* Relation for the user that created this entity.
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function createdBy()
{
return $this->belongsTo(User::class, 'created_by');
}
/**
* Relation for the user that updated this entity.
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function updatedBy()
{
return $this->belongsTo(User::class, 'updated_by');
}
/**
* Gets the class name.
* @return string
*/
public static function getClassName()
{
return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]);
}
}
Hope this makes more sense to you, I'm not a huge web/php guy.
Thanks @iamtpage,
So yeah, That's the complete wrong contents for that file. That content should be stored in app/Ownable.php
. From the composer logs I'd imagine many other files are the same and have wrong contents.
How did you download the application files? Through git or via other means?
I have the repo as a git sub module on the release
branch, I copy the files from the sub module repo to /var/www/html/:
git submodule add -b release https://github.com/BookstackApp/Bookstack.git /bookstack
mkdir -p /var/www/html
mv /bookstack/* /var/www/html/
@iamtpage It might be an idea to check the files at each stage of your process to see where they're changing. Here's what the bootstrap/init.php should look like for reference.
My .env
file was mangled, and for some reason it complained only on aarch64
. Building the same process on amd64
and arm32v7
worked without issue. Copying the .env.example
file into the directory before doing a composer install
fixed this issue.
Describe the bug When building bookstack manually, the process fails when doing a
composer install
:Steps To Reproduce Steps to reproduce the behavior:
composer install
Expected behavior No crash
Screenshots N/A
Your Configuration (please complete the following information):
Additional context Mirroring the same exact build process on arm32v7 and amd64 both work fine