Pimcoreアップデートの際のComposerパスエラーへの対処
PImcore update 4.6.3 to 4.6.4
“Composer is not installed properly”
opened 09:50AM - 28 Mar 17 UTC
closed 09:54AM - 31 Jan 19 UTC
Improvement
Make sure executables are correctly loaded from `$PATH`:
```php
$binary = 'c… omposer';
var_dump([
'path' => getenv('PATH'),
'sys' => exec('which ' . $binary),
'tool' => Tool\Console::getExecutable($binary)
]);
```
```
array (size=3)
'path' => string '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' (length=60)
'sys' => string '/usr/local/bin/composer' (length=23)
'tool' => boolean false
```
opened 09:14AM - 03 Nov 17 UTC
closed 03:18PM - 04 Feb 19 UTC
# Bug Report
We yesterday set up about 50 Installations of the latest Pimcore… built on XAMPP in windows on different machines and experienced that in at least 10% of the installations the "Check Requirements" functionality in the installation window showed PHP and Composer as red, even though PHP and Composer was installed and added to the PATH variable of the systems. So the execution of `php -v` or `composer --version` in the terminal showed the according correct results. The installation itself worked without issues, but the check was interpreting the requirements wrong.
\website\config\di.example.php —> di.phpとしてコピーして以下の内容に書き換えます。composerをインストールしたパスを指定します。
<?php
// Pimcore is using PHP-DI, see http://php-di.org/doc/
return [
"pimcore.executable.composer" => "/usr/local/bin/composer",
];
アップデート途中でアクセス権などのエラーになってしまった場合は、管理画面にアクセスできなくなるため、続きは手動でアップデートします。Pimcoreのワーキングディレクトリ内 で、以下を実行します。
$ sudo composer install --no-scripts no-plugins
$ sudo composer update --no-scripts no-plugins
アクセス権とパーミッションを再設定して下さい。
Pimcore Ver.5のcomposerによるアップデート については以下参照のこと。
特にVer.5.3からVer.5.4へのアップデートの際は、composer.json を編集する必要があります。
https://pimcore.com/docs/5.x/Development_Documentation/Installation_and_Upgrade/Upgrade_Notes/Within_V5/index.html
Pimcore管理画面でアップデートプロセスが停止したため、composerによる手動アップデート。
$ sudo composer update
$ sudo composer remove --no-update symfony/symfony amnuts/opcache-gui cache/tag-interop colinmollenhour/credis composer/ca-bundle debril/rss-atom-bundle defuse/php-encryption doctrine/annotations doctrine/cache doctrine/collections doctrine/common doctrine/dbal doctrine/doctrine-bundle doctrine/doctrine-migrations-bundle doctrine/instantiator egulias/email-validator endroid/qr-code geoip2/geoip2 google/apiclient guzzlehttp/guzzle hybridauth/hybridauth lcobucci/jwt league/csv linfo/linfo mjaschen/phpgeo monolog/monolog mpratt/embera myclabs/deep-copy myclabs/php-enum neitanod/forceutf8 nesbot/carbon ocramius/package-versions ocramius/proxy-manager oyejorge/less.php pear/net_url2 phive/twig-extensions-deferred pimcore/core-version piwik/device-detector presta/sitemap-bundle ramsey/uuid sabre/dav sensio/distribution-bundle sensio/framework-extra-bundle sensio/generator-bundle sensiolabs/ansi-to-html symfony-cmf/routing-bundle symfony/monolog-bundle symfony/polyfill-apcu symfony/swiftmailer-bundle tijsverkoyen/css-to-inline-styles twig/extensions twig/twig umpirsky/country-list vrana/adminer vrana/jush wa72/htmlpagedom zendframework/zend-code zendframework/zend-paginator zendframework/zend-servicemanager scheb/two-factor-bundle
ここで上記リンク先の内容に従ってcomposer.jsonを編集します。
$ sudo rm composer.lock
$ sudo rm -rf vender
$ sudo COMPOSER_MEMORY_LIMIT=3G composer require pimcore/pimcore:5.4.*
$ sudo -r pimcore/
$ sudo rm -r pimcore/
$ sudo rm -r web/pimcore/
アクセス権の修復とユーザ再定義
$ sudo chown -R xxx:xxx ./
$ sudo chmod -R XX0 ./
$ sudo chmod -R XXX ./var
Update Pimcore from 5.4.0 to newer version
https://pimcore.com/docs/5.x/Development_Documentation/Installation_and_Upgrade/Updating_Pimcore/index.html
composer.json のpimcore/pimcore のバージョンの箇所を更新します。
"pimcore/pimcore": "5.6.*",
アップデート(COMPOSER_MEMORY_LIMIT=-1はオプション)
$ sudo COMPOSER_MEMORY_LIMIT=-1 composer update
composer installを促すメッセージが表示された場合は、
$ sudo composer install
$ sudo bin/console pimcore:migrations:migrate -s pimcore_core -n
アクセス権を再設定します。
$ sudo chown -R admin-user:group /var/www/html/installed_dir
$ sudo chmod -R 7xx /var/www/html/installed_dir
最後にadmin管理ページでキャッシュをクリアします。
php, composer-php
v5からv6へのアップグレード
https://pimcore.com/docs/6.x/Development_Documentation/Installation_and_Upgrade/Updating_Pimcore/V5_to_V6.html
1. composer.json
の変更
"post-install-cmd": [
"Pimcore\\Composer::postInstall",
"@symfony-scripts"
],
"post-update-cmd": [
"Pimcore\\Composer::postUpdate",
"@symfony-scripts",
"Pimcore\\Composer::executeMigrationsUp"
],
"pre-package-update": [
"Pimcore\\Composer::prePackageUpdate"
],
"symfony-scripts": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
変更内容
"post-install-cmd": [
"Pimcore\\Composer::postInstall",
"@pimcore-scripts"
],
"post-update-cmd": [
"Pimcore\\Composer::postUpdate",
"@pimcore-scripts",
"Pimcore\\Composer::executeMigrationsUp",
"@pimcore-scripts"
],
"pimcore-scripts": [
"Pimcore\\Composer::clearCache",
"Pimcore\\Composer::installAssets"
]
2. /app/config/local/database.yml
を作成
doctrine:
dbal:
connections:
default:
user: username
password: password
dbname: dbname
host: host
port: 3306
3. web/app.php
のアップデート
以下リンク先の内容に書換えます。
最後にcomposer.json内の項目 “pimcore/pimcore”: “6.2.*”,に書換えて以下コマンドを実行します。
$ sudo COMPOSER_MEMORY_LIMIT=-1 composer update
上記COMPOSERによるアップデートをGCEのVM上で実行するのはお勧めしません(メモリーを最大限消費するためメモリー不足エラーが発生する可能性があります)。
Pimcore6 System Requirements
https://pimcore.com/docs/6.x/Development_Documentation/Installation_and_Upgrade/System_Requirements.html
以下データベースの設定を推奨
$ sudo pico /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
innodb_file_format = Barracuda
innodb_large_prefix = 1
innodb_file_per_table = 1
[mariadb]
plugin_load_add = ha_archive # optional but recommended, starting from mariadb 10.1 archive format is no more activated by default (check and adapt for mysql or other database software)
バージョン6.Xから6.9へのアップデート
バージョン10へのアップデート条件として、事前に6.9へのアップデートが必須
https://pimcore.com/docs/pimcore/6.9/Development_Documentation/Installation_and_Upgrade/Updating_Pimcore/index.html#page_Upgrading-within-Version-6
composer.json
ファイルのpimcore/pimcore
の項目でアップデートバージョン~6.9.0
を指定
pimcoreコンテナ内で作業(composer2.0)
$ docker exec -ti pimcore-fpm bash
composer.jsonファイルが格納されているプロジェクトフォルダへ移動しキャッシュ削除
# cd pimcore_project
キャッシュクリア
# bin/console cache:clear
または
# rm -r var/cache/*
composerによるアップデート実行
# COMPOSER_MEMORY_LIMIT=-1 composer update
アクセス権再設定
# chown -R www-data:www-data pimcore_project
# chmod -R 7xx pimcore_project
pimcore-fpm コンテナ内でcomposer により、demo またはskeleton バージョンをインストールする場合
Demoバージョン
Skeletonバージョン
データベースコンテナを --mysql-host-socket
オプションで指定してインストール
# COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton my-project
# cd ./my-project
# ./vendor/bin/pimcore-install --mysql-host-socket=Data_Base_Container_Name
Maintenance Cron Job
https://pimcore.com/docs/pimcore/current/Development_Documentation/Getting_Started/Installation.html#page_5-Maintenance-Cron-Job
opened 08:39AM - 02 Jan 20 UTC
closed 01:02PM - 02 Jan 20 UTC
Bug
BC-BREAK
# Bug Report
### Expected behavior
Pimcore Maintenance Cronjob does work witho… ut issues.
### Actual behavior
Pimcore Maintenance Cronjob does throw an exception:
> ERROR [pimcore] Failed to update MaxMind GeoIP2, size is under about 1M
### Reason
The source for the geoip database (located at https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz ) is offline. The relevant code can be found here:
https://github.com/pimcore/pimcore/blob/master/lib/Maintenance/Tasks/DownloadMaxMinDbTask.php#L42
Looks like Maxmind took this offline at 31-12-2019:
https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/
$ sudo crontab -e
*/10 * * * * docker exec pimcore10-fpm /var/www/html/pimcore10/bin/console maintenance --excludedJobs=downloadmaxminddb
アップグレードノート
https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/Upgrade_Notes/index.html
~10.5.10
変更ファイル
Configuration Environment
https://pimcore.com/docs/pimcore/current/Development_Documentation/Deployment/Configuration_Environments.html
opened 07:39AM - 20 Aug 21 UTC
Improvement
Backlog
### Improvement description
followup to https://github.com/pimcore/pimcore/pull… /9882
Right now, storage location can be defined via env-variables for each setting separately (e.g. `PIMCORE_WRITE_TARGET_IMAGE_THUMBNAILS=settings-store`).
It might be useful, to have an additional global configuration (e.g. `PIMCORE_WRITE_TARGET=settings-store`) which can be overwritten with the specific ones.
Usecases:
- Don't 'forget' a setting in the configuration (also consider settings coming from bundles)
- Make sure, all configurations are disabled, also when a new setting is added with newer versions
- Bottom line: configure the env-variable once and have it setup for all configs - no need to care about in future and eventually change deployment chain, also when updating to new versions or installing additional bundles later on
.env
......
......
MAILER_DSN=gmail+smtp://ficus.online:dfuecoiqgcbwjzox@default
PIMCORE_WRITE_TARGET_IMAGE_THUMBNAILS=settings-store
PIMCORE_WRITE_TARGET_CUSTOM_REPORTS=settings-store
PIMCORE_WRITE_TARGET_VIDEO_THUMBNAILS=settings-store
PIMCORE_WRITE_TARGET_DOCUMENT_TYPES=settings-store
PIMCORE_WRITE_TARGET_PREDEFINED_PROPERTIES=settings-store
PIMCORE_WRITE_TARGET_PREDEFINED_ASSET_METADATA=settings-store
PIMCORE_WRITE_TARGET_STATICROUTES=settings-store
security.yaml
security:
enable_authenticator_manager: true --->追加
.....
.....
# Pimcore admin form login // DO NOT CHANGE!
pimcore_admin:
anonymous: ~ --->削除
pattern: ^/admin(/.*)?$
# admin firewall is stateless as we open the admin
# session on demand for non-blocking parallel requests
stateless: true
provider: pimcore_admin
.....
.....
config.yaml
.....
.....
pimcore:
.....
.....
# archive_treshold: '30'
# archive_alternative_database: ''
templating_engine:
twig:
sandbox_security_policy:
tags: ['if']
filters: ['upper']
functions: ['include', 'path', 'range']
#### Pimcore ADMIN
pimcore_admin:
admin_csp_header:
enabled: false
exclude_paths:
- '@^/admin/external_opcache@'
.....
.....
以下 /var/config/extension.php
は次バージョンではディスコンで /config/bandle.php
にバンドルが引き継がれます。
/var/config/extension.php(
bundleと
areabricks セクション削除可)
<?php
return [
"bundle" => [
"Pimcore\\Bundle\\EcommerceFrameworkBundle\\PimcoreEcommerceFrameworkBundle" => FALSE,
"CustomerManagementFrameworkBundle\\PimcoreCustomerManagementFrameworkBundle" => FALSE,
"OutputDataConfigToolkitBundle\\OutputDataConfigToolkitBundle" => FALSE,
"Web2PrintToolsBundle\\Web2PrintToolsBundle" => FALSE,
"Pimcore\\Bundle\\DataHubBundle\\PimcoreDataHubBundle" => FALSE,
"Pimcore\\Bundle\\ObjectMergerBundle\\ObjectMergerBundle" => TRUE,
"Pimcore\\Bundle\\EcommerceFrameworkBundle\\PimcorePaymentProviderUnzerBundle" => FALSE
],
"areabrick" => [
]
];
tk-fuse
2022 年 11 月 25 日午前 12:29
#10
ドメイン変更
ドメイン変更する際の関連ファイル(データベースでの変更無し)
/var/config/system.yml
pimcore:
general:
domain: ficus.myvnc.com
redirect_to_maindomain: true
language: ja
......
......
/config/services.yaml
parameters:
......
......
#this is necessary for CLI commands to get the base url, eg. sitemap dump
router.request_context.host: ficus.myvnc.com
router.request_context.scheme: https
......
......