TypiCMS / Base

Multilingual CMS built with Laravel.
MIT License
1.39k stars 404 forks source link

404 after install #144

Closed topherseance closed 5 years ago

topherseance commented 5 years ago

Environment: OS: Windows 7, 64bit Using XAMPP latest version PHP 7.3.4 & MariaDB

Run these commands:

  1. composer create-project typicms/base mywebsite
  2. cd mywebsite
  3. php artisan typicms:install
  4. Note: if you use MariaDB, set 'mariadb' to true in config/typicms.php

Get a "404 Not found" page on both / and /admin (redirected to en/login) https://gyazo.com/05ed08df4b35b3b197c05de3be80605e

Full installation cmd log:

$ php artisan typicms:install
------------------
Welcome to TypiCMS
------------------
Publishing vendor packages...
Copied Directory [\vendor\maatwebsite\laravel-sidebar\src\resources\views]
 To [\resources\views\vendor\sidebar]
Copied Directory [\vendor\laravel\framework\src\Illuminate\Foundation\Exce
ptions\views] To [\resources\views\errors]
Copied Directory [\vendor\laravel\framework\src\Illuminate\Notifications\r
esources\views] To [\resources\views\vendor\notifications]
Copied Directory [\vendor\laravel\framework\src\Illuminate\Pagination\reso
urces\views] To [\resources\views\vendor\pagination]
Copied Directory [\vendor\typicms\translations\src\resources\views] To [\r
esources\views\vendor\translations]
Copied Directory [\vendor\typicms\blocks\src\resources\views] To [\resourc
es\views\vendor\blocks]
Copied Directory [\vendor\typicms\settings\src\resources\views] To [\resou
rces\views\vendor\settings]
Copied Directory [\vendor\typicms\users\src\resources\views] To [\resource
s\views\vendor\users]
Copied Directory [\vendor\typicms\roles\src\resources\views] To [\resource
s\views\vendor\roles]
Copied Directory [\vendor\typicms\files\src\resources\views] To [\resource
s\views\vendor\files]
Copied Directory [\vendor\typicms\dashboard\src\resources\views] To [\reso
urces\views\vendor\dashboard]
Copied Directory [\vendor\typicms\menus\src\resources\views] To [\resource
s\views\vendor\menus]
Copied Directory [\vendor\typicms\tags\src\resources\views] To [\resources
\views\vendor\tags]
Copied Directory [\vendor\typicms\tags\src\resources\scss] To [\resources\
scss]
Copied Directory [\vendor\typicms\core\src\resources\views] To [\resources
\views\vendor\core]
Copied Directory [\vendor\typicms\core\src\resources\views\errors] To [\re
sources\views\errors]
Copied Directory [\vendor\typicms\core\src\resources\js] To [\resources\js
]
Copied Directory [\vendor\typicms\core\src\resources\scss] To [\resources\
scss]
Copied Directory [\vendor\typicms\core\public] To [\public]
Copied Directory [\vendor\typicms\pages\src\resources\views] To [\resource
s\views\vendor\pages]
Copied Directory [\vendor\laravel\framework\src\Illuminate\Mail\resources\
views] To [\resources\views\vendor\mail]
Copied Directory [\vendor\laravelium\feed\src\views] To [\resources\views\
vendor\feed]
Copied Directory [\vendor\laravelium\sitemap\src\views] To [\resources\vie
ws\vendor\sitemap]
Copied Directory [\vendor\laravelium\sitemap\src\public] To [\public\vendo
r\sitemap]
Publishing complete.
------------------
Setting up database...

 Enter a database name [typicms-01]:
 > typicms_01

 What is your MySQL address? [127.0.0.1]:
 >

 What is your MySQL port? [3306]:
 >

 What is your MySQL username? [root]:
 >

 What is your MySQL password? [<none>]:
 >
A migrations table was found in database [typicms_01], no migration and se
ed were done.
------------------
Creating a Super User...

 Enter your first name:
 > Test

 Enter your last name:
 > aeouaue

 Enter your email address:
 > test1@example.com

 Enter a password:
 >

User could not be created.
------------------
chmod: invalid mode: ‘-type’
Try 'chmod --help' for more information.
Directory storage is now writable (755).
chmod: invalid mode: ‘-type’
Try 'chmod --help' for more information.
Directory bootstrap/cache is now writable (755).
------------------
Running yarn...
yarn install v1.15.2
warning package-lock.json found. Your project contains lock files generate
d by tools other than Yarn. It is advised not to mix package managers in o
rder to avoid resolution inconsistencies caused by unsynchronized lock fil
es. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "win32" is incompatible with this module
.
info "fsevents@1.2.7" is an optional dependency and failed compatibility c
heck. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 63.94s.
npm packages installed.
------------------
Done. Enjoy TypiCMS!
topherseance commented 5 years ago

Also got these error during install, but easily solved with this link: https://laravel-news.com/laravel-5-4-key-too-long-error

Error during php artisan typicms:install

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Fix on app/Providers/AppServiceProvider.php

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}
sdebacker commented 5 years ago

Please install TypiCMS on an empty database. If you look at the log, you'll see "A migrations table was found in database [typicms_01], no migration and seed were done." So the required tables could not be installed. Can you retry with an empty DB?

topherseance commented 5 years ago

Here's what I've done: (new/fresh install)

  1. Run composer create-project typicms/base typicms-02
  2. Run cd typicms-02
  3. Run php artisan typicms:install
  4. Shows this error:
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
  5. Add fixes on app/Providers/AppServiceProvider.php:
    
    use Illuminate\Support\Facades\Schema;

public function boot() { Schema::defaultStringLength(191); }

6. On `config/typicms.php`, set `mariadb` value to `true`
7. Delete & re-create the database (`typicms_02`)
8. Re-run `php artisan typicms:install`

The result:

$ php artisan typicms:install

Welcome to TypiCMS

Publishing vendor packages... Copied Directory [\vendor\maatwebsite\laravel-sidebar\src\resources\views] To [\ resources\views\vendor\sidebar] Copied Directory [\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions \views] To [\resources\views\errors] Copied Directory [\vendor\laravel\framework\src\Illuminate\Notifications\resourc es\views] To [\resources\views\vendor\notifications] Copied Directory [\vendor\laravel\framework\src\Illuminate\Pagination\resources\ views] To [\resources\views\vendor\pagination] Copied Directory [\vendor\typicms\translations\src\resources\views] To [\resourc es\views\vendor\translations] Copied Directory [\vendor\typicms\blocks\src\resources\views] To [\resources\vie ws\vendor\blocks] Copied Directory [\vendor\typicms\settings\src\resources\views] To [\resources\v iews\vendor\settings] Copied Directory [\vendor\typicms\users\src\resources\views] To [\resources\view s\vendor\users] Copied Directory [\vendor\typicms\roles\src\resources\views] To [\resources\view s\vendor\roles] Copied Directory [\vendor\typicms\files\src\resources\views] To [\resources\view s\vendor\files] Copied Directory [\vendor\typicms\dashboard\src\resources\views] To [\resources\ views\vendor\dashboard] Copied Directory [\vendor\typicms\menus\src\resources\views] To [\resources\view s\vendor\menus] Copied Directory [\vendor\typicms\tags\src\resources\views] To [\resources\views \vendor\tags] Copied Directory [\vendor\typicms\tags\src\resources\scss] To [\resources\scss] Copied Directory [\vendor\typicms\core\src\resources\views] To [\resources\views \vendor\core] Copied Directory [\vendor\typicms\core\src\resources\views\errors] To [\resource s\views\errors] Copied Directory [\vendor\typicms\core\src\resources\js] To [\resources\js] Copied Directory [\vendor\typicms\core\src\resources\scss] To [\resources\scss] Copied Directory [\vendor\typicms\core\public] To [\public] Copied Directory [\vendor\typicms\pages\src\resources\views] To [\resources\view s\vendor\pages] Copied Directory [\vendor\laravel\framework\src\Illuminate\Mail\resources\views] To [\resources\views\vendor\mail] Copied Directory [\vendor\laravelium\feed\src\views] To [\resources\views\vendor \feed] Copied Directory [\vendor\laravelium\sitemap\src\views] To [\resources\views\ven dor\sitemap] Copied Directory [\vendor\laravelium\sitemap\src\public] To [\public\vendor\site map] Publishing complete.

Setting up database...

Enter a database name [typicms-02]:

typicms_02

What is your MySQL address? [127.0.0.1]:

What is your MySQL port? [3306]:

What is your MySQL username? [root]:

What is your MySQL password? []:

Migration table created successfully. Migrating: 2012_12_06_225921_create_users_table Migrated: 2012_12_06_225921_create_users_table Migrating: 2012_12_06_225922_create_password_resets_table Migrated: 2012_12_06_225922_create_password_resets_table Migrating: 2013_08_29_174626_create_pages_table

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that cor responds to your MariaDB server version for the right syntax to use near 'json n ot null, slug json not null, uri json not null, body json not null, ' at l ine 1 (SQL: create table typicms_pages (id int unsigned not null auto_increm ent primary key, image_id int unsigned null, position int unsigned not null default '0', parent_id int unsigned null, private tinyint(1) not null defaul t '0', is_home tinyint(1) not null default '0', redirect tinyint(1) not null default '0', title json not null, slug json not null, uri json not null, body json not null, status json not null, meta_keywords json not null, me ta_description json not null, css text null, js text null, module varchar (191) null, template varchar(191) null, created_at timestamp null, updated_ at timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' e ngine = InnoDB)

at C:\Topher_Work\Laravel\typicms-02\vendor\laravel\framework\src\Illuminate\ Database\Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make th is exception a 662| // lot more helpful to the developer instead of just the databa se's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 Yo u have an error in your SQL syntax; check the manual that corresponds to your Ma riaDB server version for the right syntax to use near 'json not null, slug jso n not null, uri json not null, body json not null, ' at line 1") C:\Topher_Work\Laravel\typicms-02\vendor\laravel\framework\src\Illuminate \Database\Connection.php:452

2 PDO::prepare("create table typicms_pages (id int unsigned not null aut o_increment primary key, image_id int unsigned null, position int unsigned n ot null default '0', parent_id int unsigned null, private tinyint(1) not nul l default '0', is_home tinyint(1) not null default '0', redirect tinyint(1) not null default '0', title json not null, slug json not null, uri json no t null, body json not null, status json not null, meta_keywords json not n ull, meta_description json not null, css text null, js text null, module varchar(191) null, template varchar(191) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4_unico de_ci' engine = InnoDB") C:\Topher_Work\Laravel\typicms-02\vendor\laravel\framework\src\Illuminate \Database\Connection.php:452

Please use the argument -v to see more details.



Seems like a common issue regarding `JSON` datatype on MariaDB and MySQL:

- https://github.com/laravel/framework/issues/13622
- https://stackoverflow.com/questions/42185598/1064-you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds
topherseance commented 5 years ago

Here's excerpt from my XAMPP's readme. (/xampp/readme_en.txt) I think MariaDB 10.1 doesn't have support for JSON datatype

###### ApacheFriends XAMPP Version 7.3.4 ######

Important! PHP in this package needs the Microsoft Visual C++ 2015 Redistributable package from
http://www.microsoft.com/en-us/download/. Please ensure that the VC++ 2015 runtime
libraries are installed on your system.

  + Apache 2.4.39
  + MariaDB 10.1.38
  + PHP 7.3.4 (VC15 X86 64bit thread safe) + PEAR
  + phpMyAdmin 4.8.5
  + OpenSSL 1.1.0g
  + ADOdb 518a
  + Mercury Mail Transport System v4.63 (not included in the portable version)
  + FileZilla FTP Server 0.9.41 (not included in the portable version)
  + Webalizer 2.23-04 (not included in the portable version)
  + Strawberry Perl 5.16.3.1 Portable
  + Tomcat 7.0.92
  + XAMPP Control Panel Version 3.2.3.
  + XAMPP mailToDisk 1.0 (write emails via PHP on local disk in <xampp>\mailoutput. Activated in the php.ini as mail default.)

...
sdebacker commented 5 years ago

Of course you need the latest version of MariaDB. Let me know if it works better.