shyim / shopware-docker

Easy to use Docker Installation for Shopware 5 and Shopware 6
MIT License
115 stars 27 forks source link

Allow to set PHP version for CLI image #92

Closed zaifastafa closed 3 years ago

zaifastafa commented 3 years ago

We have an option at the moment to configure a php version for a host image. But the cli still uses the one defined in the .env file.

This approach does not work properly when for e.g we want to setup sw5 with php 5.6 because there is no 5.6 image available. When using 5.6 image with 7.3 version I get the following error:

Apply MigrationNumber: 220 - add-payment-data-restriction

  [Exception]                                                                                                                                                                                                                                                           
  Could not apply migration (Migrations_Migration220). Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TA  
  BLE `s_core_payment_data` ADD UNIQUE (                                                                                                                                                                                                                                
              `payment_mean_id` ,                                                                                                                                                                                                                                       
  ' at line 1                                                                                                                                                                                                                                                           

sw:migrations:migrate [--mode MODE]

ERROR 1054 (42S22) at line 9: Unknown column 'product_box_layout' in 'field list'
 WARNING! The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found in 'Shopware\Models\Customer\Address#attribute'. in /var/www/html/sw5/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php 

  [Doctrine\ORM\Mapping\MappingException]                                                                                       
  The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found in 'Shopware\Models\Customer\Address#attribute'.  

sw:generate:attributes

  [Doctrine\DBAL\DBALException]                                                                                                                                                                                                                                         
  An exception occurred while executing 'SELECT t0.id AS id_1, t0.name AS name_2, t0.label AS label_3, t0.namespace AS namespace_4, t0.source AS source_5, t0.description AS description_6, t0.active AS active_7, t0.added AS added_8, t0.installation_date AS instal  
  lation_date_9, t0.update_date AS update_date_10, t0.refresh_date AS refresh_date_11, t0.author AS author_12, t0.copyright AS copyright_13, t0.license AS license_14, t0.version AS version_15, t0.support AS support_16, t0.changes AS changes_17, t0.link AS link_1  
  8, t0.update_version AS update_version_19, t0.update_source AS update_source_20, t0.capability_update AS capability_update_21, t0.capability_install AS capability_install_22, t0.capability_enable AS capability_enable_23, t0.capability_secure_uninstall AS capab  
  ility_secure_uninstall_24, t0.translations AS translations_25, t0.in_safe_mode AS in_safe_mode_26 FROM s_core_plugins t0 WHERE t0.active = ?' with params [1]:                                                                                                        

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.capability_secure_uninstall' in 'field list'                                                                                                                                                               

  [PDOException]                                                                                           
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.capability_secure_uninstall' in 'field list'  

sw:snippets:to:db [--include-plugins] [-f|--force] [--source SOURCE]

  [Doctrine\DBAL\DBALException]                                                                                                                                                                                                                                         
  An exception occurred while executing 'SELECT s0_.id AS id_0, s0_.main_id AS main_id_1, s0_.category_id AS category_id_2, s0_.name AS name_3, s0_.title AS title_4, s0_.position AS position_5, s0_.host AS host_6, s0_.base_path AS base_path_7, s0_.base_url AS ba  
  se_url_8, s0_.hosts AS hosts_9, s0_.secure AS secure_10, s0_.template_id AS template_id_11, s0_.`default` AS default_12, s0_.active AS active_13, s0_.customer_scope AS customer_scope_14, s0_.id AS id_15, s0_.main_id AS main_id_16, s0_.category_id AS category_i  
  d_17, s0_.name AS name_18, s0_.title AS title_19, s0_.position AS position_20, s0_.host AS host_21, s0_.base_path AS base_path_22, s0_.base_url AS base_url_23, s0_.hosts AS hosts_24, s0_.secure AS secure_25, s0_.template_id AS template_id_26, s0_.`default` AS   
  default_27, s0_.active AS active_28, s0_.customer_scope AS customer_scope_29, s1_.id AS id_30, s1_.main_id AS main_id_31, s1_.category_id AS category_id_32, s1_.name AS name_33, s1_.title AS title_34, s1_.position AS position_35, s1_.host AS host_36, s1_.base_  
  path AS base_path_37, s1_.base_url AS base_url_38, s1_.hosts AS hosts_39, s1_.secure AS secure_40, s1_.template_id AS template_id_41, s1_.`default` AS default_42, s1_.active AS active_43, s1_.customer_scope AS customer_scope_44, s2_.id AS id_45, s2_.locale AS   
  locale_46, s2_.language AS language_47, s2_.territory AS territory_48, s3_.id AS id_49, s3_.currency AS currency_50, s3_.name AS name_51, s3_.standard AS standard_52, s3_.factor AS factor_53, s3_.templatechar AS templatechar_54, s3_.symbol_position AS symbol_p  
  osition_55, s3_.position AS position_56, s4_.id AS id_57, s4_.template AS template_58, s4_.name AS name_59, s4_.description AS description_60, s4_.author AS author_61, s4_.license AS license_62, s4_.esi AS esi_63, s4_.style_support AS style_support_64, s4_.emo  
  tion AS emotion_65, s4_.version AS version_66, s4_.plugin_id AS plugin_id_67, s4_.parent_id AS parent_id_68, s5_.id AS id_69, s5_.template AS template_70, s5_.name AS name_71, s5_.description AS description_72, s5_.author AS author_73, s5_.license AS license_7  
  4, s5_.esi AS esi_75, s5_.style_support AS style_support_76, s5_.emotion AS emotion_77, s5_.version AS version_78, s5_.plugin_id AS plugin_id_79, s5_.parent_id AS parent_id_80, s6_.id AS id_81, s6_.currency AS currency_82, s6_.name AS name_83, s6_.standard AS   
  standard_84, s6_.factor AS factor_85, s6_.templatechar AS templatechar_86, s6_.symbol_position AS symbol_position_87, s6_.position AS position_88, s7_.id AS id_89, s7_.groupkey AS groupkey_90, s7_.description AS description_91, s7_.tax AS tax_92, s7_.taxinput   
  AS taxinput_93, s7_.mode AS mode_94, s7_.discount AS discount_95, s7_.minimumorder AS minimumorder_96, s7_.minimumordersurcharge AS minimumordersurcharge_97, s8_.id AS id_98, s8_.template AS template_99, s8_.name AS name_100, s8_.description AS description_101  
  , s8_.author AS author_102, s8_.license AS license_103, s8_.esi AS esi_104, s8_.style_support AS style_support_105, s8_.emotion AS emotion_106, s8_.version AS version_107, s8_.plugin_id AS plugin_id_108, s8_.parent_id AS parent_id_109, s0_.main_id AS main_id_1  
  10, s0_.template_id AS template_id_111, s0_.document_template_id AS document_template_id_112, s0_.category_id AS category_id_113, s0_.locale_id AS locale_id_114, s0_.currency_id AS currency_id_115, s0_.customer_group_id AS customer_group_id_116, s0_.fallback_i  
  d AS fallback_id_117, s1_.main_id AS main_id_118, s1_.template_id AS template_id_119, s1_.document_template_id AS document_template_id_120, s1_.category_id AS category_id_121, s1_.locale_id AS locale_id_122, s1_.currency_id AS currency_id_123, s1_.customer_gro  
  up_id AS customer_group_id_124, s1_.fallback_id AS fallback_id_125, s4_.parent_id AS parent_id_126, s4_.plugin_id AS plugin_id_127, s5_.parent_id AS parent_id_128, s5_.plugin_id AS plugin_id_129, s8_.parent_id AS parent_id_130, s8_.plugin_id AS plugin_id_131 F  
  ROM s_core_shops s0_ LEFT JOIN s_core_shops s1_ ON s0_.main_id = s1_.id LEFT JOIN s_core_locales s2_ ON s0_.locale_id = s2_.id LEFT JOIN s_core_currencies s3_ ON s0_.currency_id = s3_.id LEFT JOIN s_core_templates s4_ ON s0_.template_id = s4_.id LEFT JOIN s_co  
  re_templates s5_ ON s0_.document_template_id = s5_.id LEFT JOIN s_core_shop_currencies s9_ ON s0_.id = s9_.shop_id LEFT JOIN s_core_currencies s6_ ON s6_.id = s9_.currency_id LEFT JOIN s_core_customergroups s7_ ON s0_.customer_group_id = s7_.id LEFT JOIN s_cor  
  e_templates s8_ ON s1_.template_id = s8_.id LEFT JOIN s_core_shop_currencies s11_ ON s1_.id = s11_.shop_id LEFT JOIN s_core_currencies s10_ ON s10_.id = s11_.currency_id WHERE s0_.active = 1 AND s0_.`default` = 1 ORDER BY s0_.main_id ASC, s0_.position ASC, s6_  
  .position ASC, s6_.id ASC':                                                                                                                                                                                                                                           

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 's4_.parent_id' in 'field list'                                                                                                                                                                                

  [PDOException]                                                                          
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 's4_.parent_id' in 'field list'  

Using Shopware 5.4 PHP 7.3 / 7.4 nginx 56-xdebug and 73-xdebug tried both mysql 57 (using --mysql-host)

shyim commented 3 years ago

set the normal php version lower and override it for the vhost to an higher version

zaifastafa commented 3 years ago

there is no option to set 5.6 in the PHP version. It says unknown name error.

shyim commented 3 years ago

7.2 should also work for this error

zaifastafa commented 3 years ago

ok - will try and close it if all works fine. thanks.