mybb / mybb2

The repository for the MyBB 2 forum software. Not to be used on live boards.
https://www.mybb.com
BSD 3-Clause "New" or "Revised" License
112 stars 45 forks source link

Install Mybb2 development copy without Homestead? #290

Closed RezaRamezanpour closed 7 years ago

RezaRamezanpour commented 7 years ago

I'm trying to install a mybb2 development project in my localhost on ubuntu. I downloaded it from this repo and extract it to the /www folder. Run composer install command everything seems right but at the end of instalation artisan doses'n generate any code with this error:

Generating autoload files

php -r "copy('.env.example', '.env');" php artisan key:generate

[RuntimeException]
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Script php artisan key:generate handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

Can anyone give me a hand? i wish to install mybb2 without Laravel Homestead.

euantorano commented 7 years ago

Looks like this is due to a step I missed during a Laravel upgrade: https://github.com/laravel/framework/issues/9080

I'm away from home this weekend, but will push a patch on Tuesday.

On 28 May 2017, at 14:54, R.Ramezanpour notifications@github.com wrote:

I'm trying to install a mybb2 development project in my localhost on ubuntu. I downloaded it from this repo and extract it to the /www folder. Run composer install command everything seems right but at the end of instalation artisan doses'n generate any code with this error:

Generating autoload files

php -r "copy('.env.example', '.env');" php artisan key:generate

[RuntimeException] The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Script php artisan key:generate handling the post-install-cmd event returned with an error

[RuntimeException] Error Output:

Can anyone give me a hand? i wish to install mybb2 without Laravel Homestead.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

RezaRamezanpour commented 7 years ago

Thank you for the reply. I've already read almost all of that(https://github.com/laravel/framework/issues/9080), Problem not solved :|

JoshHarmon commented 7 years ago

The key should be 32 8-bit characters for 256-bit (key length) AES. Try changing it and running php artisan config:cache and then optionally php artisan key:generate to generate a new one that is base64'd and written into the config file.

Right now, the key is 16 8-bit characters and that doesn't work so well when the specified cipher expects a 256-bit key.

At least that's what I gathered earlier when I looked.

RezaRamezanpour commented 7 years ago

It seems the artisan dont works at all.

$ php artisan config:cache

[RuntimeException]
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
And result of command $ php artisan key:generate are the same as first command.

Here is my .env file contents that is no difference with .env.example

APP_ENV=local APP_DEBUG=true APP_KEY=SomeRandomString

DB_HOST=localhost DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret

CACHE_DRIVER=file SESSION_DRIVER=file

JoshHarmon commented 7 years ago

@reza-irdev Well, yeah; you haven't changed the key to be 32 characters. ;)

RezaRamezanpour commented 7 years ago

@JoshHarmon OK! now what i should do? thanks!

Matslom commented 7 years ago

@reza-irdev check this line https://github.com/mybb/mybb2/pull/288/files#diff-cbfd64a28982a1818f2b5f16e7f9d634L3

RezaRamezanpour commented 7 years ago

@Matslom Thanks a lot. problem solved with APP_KEY :+1: But we have new errors :))

irdev@irdev:~/htdocs/mybb2-master$ php artisan migrate:install Migration table created successfully. irdev@irdev:~/htdocs/mybb2-master$ php artisan migrate Migrated: 2014_10_12_000000_create_users_table Migrated: 2014_10_12_100000_create_password_resets_table Migrated: 2015_02_06_193129_create_forums_table Migrated: 2015_02_06_193135_create_posts_table Migrated: 2015_02_06_193141_create_topics_table Migrated: 2015_02_12_025505_create_roles_table Migrated: 2015_02_12_025520_create_permissions_table Migrated: 2015_02_12_025532_create_permission_role_table Migrated: 2015_02_14_220949_add_num_posts_to_topics_table Migrated: 2015_02_16_164601_create_parser_badwords_table Migrated: 2015_02_16_164601_create_parser_mycode_table Migrated: 2015_02_16_164601_create_parser_smilies_table Migrated: 2015_02_24_131001_create_user_settings_table Migrated: 2015_02_26_122601_create_confirmations_table Migrated: 2015_02_26_133000_add_last_visit_to_users_table Migrated: 2015_02_26_153000_add_num_posts_to_users_table Migrated: 2015_02_26_153000_soft_delete_to_posts_table Migrated: 2015_02_27_135400_add_guest_posting Migrated: 2015_03_06_110928_create_settings_table Migrated: 2015_03_06_110933_create_setting_values_table Migrated: 2015_03_06_121600_create_searchlog_table Migrated: 2015_03_06_174600_add_last_page Migrated: 2015_03_07_143000_fix_guest_searching Migrated: 2015_03_07_213700_remove_user_settings Migrated: 2015_03_07_220139_remove_is_user_setting_from_settings_table Migrated: 2015_03_15_144612_create_user_activity_table Migrated: 2015_03_16_220356_create_session_table Migrated: 2015_03_16_231829_create_profile_fields_table Migrated: 2015_03_16_232644_create_profile_field_options_table Migrated: 2015_03_16_232844_create_user_profile_fields_table Migrated: 2015_03_19_190100_create_polls_table Migrated: 2015_03_19_211900_create_poll_votes_table Migrated: 2015_03_21_114200_add_mybb_captcha Migrated: 2015_03_23_213855_create_profile_field_group_table Migrated: 2015_03_29_103911_create_likes_table Migrated: 2015_03_29_145952_add_num_likes_to_users_table Migrated: 2015_03_29_145958_add_num_likes_to_posts_table Migrated: 2015_04_03_143500_remove_role_id_from_users Migrated: 2015_04_03_143501_create_role_user_pivot_table Migrated: 2015_04_03_143502_modify_permissions_table Migrated: 2015_04_03_143503_modify_permission_role_table Migrated: 2015_04_05_120800_create_content_class_table Migrated: 2015_04_07_132222_add_approved_to_posts_and_topics Migrated: 2015_04_12_140000_create_conversation_table Migrated: 2015_04_12_140001_create_conversation_messages_table Migrated: 2015_04_12_140002_create_conversation_user_table Migrated: 2015_04_17_113600_remove_unique_slug Migrated: 2015_04_18_172533_add_closed_to_topics_and_forums_tables Migrated: 2015_08_03_213002_create_moderation_log_tables Migrated: 2016_09_01_163636_create_warnings_table Migrated: 2016_09_03_090139_add_warnings_to_users_table Migrated: 2016_09_03_090659_create_warning_types_table Migrated: 2016_09_06_134433_add_sticky_to_topics_tables Migrated: 2016_11_04_190327_rename_search_id_to_token Migrated: 2016_11_19_163000_add_can_user_override_to_settings_table Migrated: 2017_02_15_193903_add_options_to_settings_table Migrated: 2017_03_05_123720_create_tasks_table Migrated: 2017_03_08_160035_create_task_logs_table irdev@irdev:~/htdocs/mybb2-master$ php artisan db:seed Seeding: ContentClassTableSeeder Seeding: UsersTableSeeder Seeding: RolesTableSeeder Seeding: RoleUserTableSeeder Seeding: PermissionsTableSeeder Seeding: PermissionRoleTableSeeder Seeding: ForumsTableSeeder Seeding: TopicsTableSeeder Seeding: PostsTableSeeder Seeding: UserSettingsTableSeeder Seeding: SettingsTableSeeder

[Illuminate\Database\QueryException]
SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match
value count at row 7 (SQL: insert into settings (name, setting_type) values (general.boar
d_name, string), (general.board_desc, string), (general.site_name, string), (general.site_url,
string), (wio.minutes, number), (wio.refresh, number), (captcha.method, captcha, choose), (capt
cha.recaptcha_public_key, string), (captcha.recaptcha_privatekey, string), (captcha.nocaptcha
public_key, string), (captcha.nocaptcha_private_key, string), (user.date_format, string), (user
.time_format, number), (user.timezone, string), (user.dst, enable|disable|auto, radio), (user.f
ollow_started_topics, checkbox), (user.follow_replied_topics, checkbox), (user.show_editor, che
ckbox), (user.topics_per_page, number), (user.posts_per_page, number), (user.style, string), (u
ser.language, string), (user.notify_on_like, checkbox), (user.notify_on_quote, checkbox), (user
.notify_on_reply, checkbox), (user.notify_on_new_post, checkbox), (user.notify_on_new_comment,
checkbox), (user.notify_on_comment_like, checkbox), (user.notify_on_my_comment_like, checkbox),
(user.notify_on_comment_reply, checkbox), (user.notify_on_my_comment_reply, checkbox), (user.n
otify_on_new_message, checkbox), (user.notify_on_reply_message, checkbox), (user.notify_on_grou
p_request, checkbox), (user.notify_on_moderation_post, checkbox), (user.notify_on_report, check
box), (user.notify_on_username_change, checkbox), (user.notification_mails, checkbox), (user.sh
owonline, checkbox), (user.receive_messages, checkbox), (user.block_blocked_messages, checkbox)
, (user.hide_blocked_posts, checkbox), (user.only_buddy_messages, checkbox), (user.receive_emai
l, checkbox), (user.dob_privacy, nothing|age|dob, radio), (user.dob_visibility, everyone|member
s|following, radio), (post.likes_to_show, number), (likes.per_page, number), (memberlist.sort_b
y, created_at|num_posts|num_topics|name, choose), (memberlist.sort_dir, desc|asc, choose), (mem
berlist.per_page, number), (conversations.enabled, switch), (conversations.message_order, desc|
asc, choose), (warnings.max_points, number), (warnings.allow_zero, switch), (warnings.allow_cus
tom, switch), (tasks.on_page, switch), (tasks.interval, number), (tasks.max_log_life, number),
(moderation.max_log_life, number))

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match
value count at row 7

[PDOException]
SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match
value count at row 7

irdev@irdev:~/htdocs/mybb2-master$ php artisan db:seed Seeding: ContentClassTableSeeder

[Illuminate\Database\QueryException]
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a f
oreign key constraint fails (mybb2.permissions, CONSTRAINT permissions_content_name_foreig n FOREIGN KEY (content_name) REFERENCES content_class (content)) (SQL: delete from cont ent_class)

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a f
oreign key constraint fails (mybb2.permissions, CONSTRAINT permissions_content_name_foreig n FOREIGN KEY (content_name) REFERENCES content_class (content))

[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a f
oreign key constraint fails (mybb2.permissions, CONSTRAINT permissions_content_name_foreig n FOREIGN KEY (content_name) REFERENCES content_class (content))

Any solution?

euantorano commented 7 years ago

Interesting. Looks like an issue with settings insertion, I will need to look into that.

savander commented 7 years ago

You have to split this line into two different inserts. Laravel can't handle random fields number, so each line where options field occurs have to be moved to another execution.

Before anyone from the team will fix that, you can replace SettingsTableSeeder.php with fixed one: https://pastebin.com/59tzSfWR

After that, you have to refresh your database: php artisan migrate:refresh