簡體   English   中英

TYPO3 的作曲家安裝導致 http 500

[英]composer install of TYPO3 results in http 500

簡短的介紹

我嘗試在 Debian 10 服務器上使用 composer 設置基本的 TYPO3 安裝。 按照我能找到的所有官方說明,導致 http 錯誤 500 在服務器日志中沒有有意義的(對我而言)內容。

我首先在客戶端服務器上遇到了這個問題,所以我安裝了一個全新的虛擬服務器以進行調試,並遇到了完全相同的問題。

我做了一件事,這可能會為知情人士指出解決方案:

web-devel@typo-test:/var/www/html/typotest/public$ cp index.php test.php

$ vi test.php
-> insert "print(__DIR__);" before call_user_func shows me a current path of 
/var/www/html/typotest/public

這將導致 /var/www/html/typotest/public/vendor/autoload.php 的路徑不存在。

但是,用“/var/www/html/typotest/”替換對__DIR__的引用並不能改善事情......

TYPO3 版本 9 和 10 相同

我找不到任何關於這個問題的提及,這讓我感到驚訝,因為它是一種簡單的方法。 對於任何指向解決方案或至少調試提示的指針,我都會很高興......


詳細描述

-- Debian Gnu/Linux 10 已應用所有補丁,服務器 IP 為 192.168.100.171

-- Apache/PHP/XML/MySQL 安裝並運行

-- 根據https://docs.typo3.org/m/typo3/guide-installation/master/en-us/In-depth/SystemRequirements/Index.ZFC35FDC70D5FC69D2698EZ83A822設置先決條件

-- 准備數據庫:

> MariaDB [(none)]> create database typotest;
Query OK, 1 row affected (0.000 sec)


> MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'web-devel'@'localhost' identified by 'XXXXXX';
Query OK, 0 rows affected (0.000 sec)

-- 將瀏覽器指向 IP 會導致顯示位於 /var/www/html 中的默認 debian 索引頁面

-- 創建了一個正確顯示的 info.php。

-- 我意識到,我沒有最新的作曲家版本。 建議的作曲家自我更新失敗,所以我根據https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-debian-10安裝了作曲家

# php composer-setup.php --install-dir=/usr/local/bin --filename=composer
All settings correct for using Composer
Downloading...

Composer (version 1.10.8) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

——所以,一切似乎都很好

-- Next step - install TYPO3 according to https://docs.typo3.org/m/typo3/guide-installation/master/en-us/QuickInstall/Composer/Index.html

$ cd /var/www/html

$ /usr/local/bin/composer create-project typo3/cms-base-distribution typotest

$ cd typotest

$ php vendor/bin/typo3cms install:setup \
    --no-interaction \
    --database-user-name=web-devel \
    --database-user-password=XXXXXXX \
    --database-host-name=127.0.0.1 \
    --database-port=3306 \
    --database-name=typotest \
    --use-existing-database \
    --admin-user-name=admin \
    --admin-password=XXXXXXX \
    --site-setup-type=site

- 完美無瑕:

web-devel@typo-test:/var/www/html$ /usr/local/bin/composer create-project typo3/cms-base-distribution typotest
Creating a "typo3/cms-base-distribution" project at "./typotest"
Installing typo3/cms-base-distribution (v10.4.1)
  - Installing typo3/cms-base-distribution (v10.4.1): Loading from cache
Created project in /var/www/html/typotest
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 87 installs, 0 updates, 0 removals
  - Installing typo3/cms-composer-installers (v3.0.1): Loading from cache
  - Installing typo3/class-alias-loader (v1.1.3): Loading from cache
  - Installing helhum/config-loader (v0.12.2): Loading from cache
  - Installing symfony/polyfill-php80 (v1.17.1): Loading from cache
  - Installing symfony/process (v4.4.10): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.17.1): Loading from cache
  - Installing symfony/polyfill-ctype (v1.17.1): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/service-contracts (v1.1.8): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing symfony/polyfill-php73 (v1.17.1): Loading from cache
  - Installing symfony/console (v4.4.10): Loading from cache
  - Installing doctrine/lexer (1.2.1): Loading from cache
  - Installing doctrine/annotations (1.10.3): Loading from cache
  - Installing typo3fluid/fluid (2.6.9): Loading from cache
  - Installing typo3/phar-stream-wrapper (v3.1.5): Loading from cache
  - Installing typo3/cms-cli (2.0.0): Loading from cache
  - Installing symfony/yaml (v4.4.10): Loading from cache
  - Installing symfony/routing (v4.4.10): Loading from cache
  - Installing symfony/polyfill-php72 (v1.17.0): Loading from cache
  - Installing symfony/polyfill-intl-idn (v1.17.1): Loading from cache
  - Installing symfony/polyfill-intl-icu (v1.17.1): Loading from cache
  - Installing symfony/intl (v4.4.10): Loading from cache
  - Installing symfony/mime (v4.4.10): Loading from cache
  - Installing psr/event-dispatcher (1.0.0): Loading from cache
  - Installing symfony/event-dispatcher-contracts (v1.1.7): Loading from cache
  - Installing symfony/event-dispatcher (v4.4.10): Loading from cache
  - Installing psr/log (1.1.3): Loading from cache
  - Installing egulias/email-validator (2.1.18): Loading from cache
  - Installing symfony/mailer (v4.4.10): Loading from cache
  - Installing symfony/http-foundation (v4.4.10): Loading from cache
  - Installing symfony/finder (v4.4.10): Loading from cache
  - Installing symfony/var-exporter (v4.4.10): Loading from cache
  - Installing symfony/cache-contracts (v1.1.7): Loading from cache
  - Installing symfony/cache (v4.4.10): Loading from cache
  - Installing symfony/expression-language (v4.4.10): Loading from cache
  - Installing symfony/dependency-injection (v4.4.10): Loading from cache
  - Installing symfony/filesystem (v4.4.10): Loading from cache
  - Installing symfony/config (v4.4.10): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing psr/http-server-handler (1.0.1): Loading from cache
  - Installing psr/http-server-middleware (1.0.1): Loading from cache
  - Installing psr/http-factory (1.0.1): Loading from cache
  - Installing psr/http-client (1.0.0): Loading from cache
  - Installing nikic/php-parser (v4.5.0): Loading from cache
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.5.5): Loading from cache
  - Installing doctrine/instantiator (1.3.1): Loading from cache
  - Installing doctrine/event-manager (1.1.0): Loading from cache
  - Installing doctrine/cache (1.10.1): Loading from cache
  - Installing doctrine/dbal (2.10.2): Loading from cache
  - Installing cogpowered/finediff (0.3.1): Loading from cache
  - Installing typo3/cms-core (v10.4.4): Loading from cache
  - Installing symfony/inflector (v4.4.10): Loading from cache
  - Installing symfony/property-info (v4.4.10): Loading from cache
  - Installing symfony/property-access (v4.4.10): Loading from cache
  - Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.3.0): Loading from cache
  - Installing webmozart/assert (1.9.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (5.1.0): Loading from cache
  - Installing typo3/cms-extbase (v10.4.4): Loading from cache
  - Installing typo3/cms-fluid (v10.4.4): Loading from cache
  - Installing typo3/cms-install (v10.4.4): Loading from cache
  - Installing typo3/cms-frontend (v10.4.4): Loading from cache
  - Installing typo3/cms-extensionmanager (v10.4.4): Loading from cache
  - Installing typo3/cms-recordlist (v10.4.4): Loading from cache
  - Installing typo3/cms-backend (v10.4.4): Loading from cache
  - Installing helhum/typo3-console (v6.3.2): Loading from cache
  - Installing typo3/cms-about (v10.4.4): Loading from cache
  - Installing typo3/cms-viewpage (v10.4.4): Loading from cache
  - Installing typo3/cms-tstemplate (v10.4.4): Loading from cache
  - Installing typo3/cms-t3editor (v10.4.4): Loading from cache
  - Installing typo3/cms-sys-note (v10.4.4): Loading from cache
  - Installing typo3/cms-setup (v10.4.4): Loading from cache
  - Installing typo3/cms-seo (v10.4.4): Loading from cache
  - Installing typo3/cms-rte-ckeditor (v10.4.4): Loading from cache
  - Installing typo3/cms-info (v10.4.4): Loading from cache
  - Installing typo3/cms-impexp (v10.4.4): Loading from cache
  - Installing typo3/cms-form (v10.4.4): Loading from cache
  - Installing typo3/cms-fluid-styled-content (v10.4.4): Loading from cache
  - Installing typo3/cms-filelist (v10.4.4): Loading from cache
  - Installing typo3/cms-felogin (v10.4.4): Loading from cache
  - Installing typo3/cms-dashboard (v10.4.4): Loading from cache
  - Installing typo3/cms-beuser (v10.4.4): Loading from cache
  - Installing typo3/cms-belog (v10.4.4): Loading from cache
helhum/config-loader suggests installing ext-yaml (For improved performance when parsing yaml files you should use the PECL YAML Parser php extension)
symfony/console suggests installing symfony/lock
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
symfony/polyfill-intl-icu suggests installing ext-intl (For best performance)
symfony/intl suggests installing ext-intl (to use the component with locales other than "en")
symfony/event-dispatcher suggests installing symfony/http-kernel
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
typo3/cms-core suggests installing ext-gd (GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images)
typo3/cms-core suggests installing ext-intl (TYPO3 with unicode-based filesystems)
typo3/cms-core suggests installing ext-zip
symfony/property-info suggests installing symfony/doctrine-bridge (To use Doctrine metadata)
symfony/property-info suggests installing symfony/serializer (To use Serializer metadata)
typo3/cms-extbase suggests installing typo3/cms-scheduler (Additional scheduler tasks)
typo3/cms-frontend suggests installing typo3/cms-adminpanel (Provides additional information and functionality for backend users in the frontend.)
Writing lock file
Generating autoload files
Generating class alias map file
> typo3cms install:fixfolderstructure
The following directory structure has been fixed:
Directory /public/typo3temp successfully created.
Fixed permission on /public/typo3temp.
File /public/typo3temp/index.html successfully created.
Set content to /public/typo3temp/index.html
Fixed permission on /public/typo3temp/index.html.
Directory /public/typo3temp/assets successfully created.
Fixed permission on /public/typo3temp/assets.
Directory /public/typo3temp/assets/compressed successfully created.
Fixed permission on /public/typo3temp/assets/compressed.
Directory /public/typo3temp/assets/css successfully created.
Fixed permission on /public/typo3temp/assets/css.
Directory /public/typo3temp/assets/js successfully created.
Fixed permission on /public/typo3temp/assets/js.
Directory /public/typo3temp/assets/images successfully created.
Fixed permission on /public/typo3temp/assets/images.
Directory /public/typo3temp/assets/_processed_ successfully created.
Fixed permission on /public/typo3temp/assets/_processed_.
Directory /public/typo3conf successfully created.
Fixed permission on /public/typo3conf.
Directory /public/typo3conf/ext successfully created.
Fixed permission on /public/typo3conf/ext.
Directory /public/fileadmin successfully created.
Fixed permission on /public/fileadmin.
Directory /public/fileadmin/_temp_ successfully created.
Fixed permission on /public/fileadmin/_temp_.
File /public/fileadmin/_temp_/.htaccess successfully created.
Set content to /public/fileadmin/_temp_/.htaccess
Fixed permission on /public/fileadmin/_temp_/.htaccess.
File /public/fileadmin/_temp_/index.html successfully created.
Set content to /public/fileadmin/_temp_/index.html
Fixed permission on /public/fileadmin/_temp_/index.html.
Directory /public/fileadmin/user_upload successfully created.
Fixed permission on /public/fileadmin/user_upload.
Directory /public/fileadmin/user_upload/_temp_ successfully created.
Fixed permission on /public/fileadmin/user_upload/_temp_.
File /public/fileadmin/user_upload/_temp_/index.html successfully created.
Set content to /public/fileadmin/user_upload/_temp_/index.html
Fixed permission on /public/fileadmin/user_upload/_temp_/index.html.
Directory /public/fileadmin/user_upload/_temp_/importexport successfully created.
Fixed permission on /public/fileadmin/user_upload/_temp_/importexport.
File /public/fileadmin/user_upload/_temp_/importexport/.htaccess successfully created.
Set content to /public/fileadmin/user_upload/_temp_/importexport/.htaccess
Fixed permission on /public/fileadmin/user_upload/_temp_/importexport/.htaccess.
File /public/fileadmin/user_upload/_temp_/importexport/index.html successfully created.
Set content to /public/fileadmin/user_upload/_temp_/importexport/index.html
Fixed permission on /public/fileadmin/user_upload/_temp_/importexport/index.html.
File /public/fileadmin/user_upload/index.html successfully created.
Set content to /public/fileadmin/user_upload/index.html
Fixed permission on /public/fileadmin/user_upload/index.html.
File /var/.htaccess successfully created.
Set content to /var/.htaccess
Fixed permission on /var/.htaccess.
Directory /var/charset successfully created.
Fixed permission on /var/charset.
Directory /var/labels successfully created.
Fixed permission on /var/labels.
Directory /var/lock successfully created.
Fixed permission on /var/lock.
> typo3cms install:generatepackagestates
The following extensions have been added to the generated PackageStates.php file: core, extbase, fluid, frontend, fluid_styled_content, filelist, impexp, form, install, recordlist, backend, setup, rte_ckeditor, about, belog, beuser, dashboard, extensionmanager, felogin, info, seo, sys_note, t3editor, tstemplate, viewpage
31 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

然后

web-devel@typo-test:/var/www/html$ php typotest/vendor/bin/typo3cms install:setup    

Welcome to the TYPO3 Console installer!

➤ Prepare installation


✔ Check environment and create folders
➤ Set up database connection
Database connection type (default: "mysqli"):
  [mysqli    ] MySQL connection
  [pdo_sqlite] SQLite connection
  [pdo_pgsql ] PostgreSQL connection
  [mssql     ] MSSQL connection
 > mysqli
User name for database server (default: ""): web-devel
User password for database server (default: ""):
Host name of database server (default: "127.0.0.1"):
TCP Port of database server (default: "3306"):
Unix Socket to connect to (default: ""):
✔ Ok
➤ Select database
Use already existing database? (y/N): y
Name of the database (required): typotest
✔ Ok
➤ Set up database
Username of to be created administrative user account (required): admin
Password of to be created administrative user account (required):
Name of the TYPO3 site (default: "New TYPO3 Console site"): Test Site
✔ Ok
➤ Set up configuration
Specify the site setup type (default: "no"):
  [no  ] Do nothing
  [site] Create root page
 > site
Specify the site base url (default: "/"):
✔ Ok
➤ Set up web server configuration
Specify the web server you want to write configuration for (default: "none"):
  [none  ] Do not write any configuration files
  [apache] Create Apache .htaccess file
  [iis   ] Create Microsoft-IIS web.config file
 > apache
✔ Ok
✔ Set up extensions

Successfully installed TYPO3 CMS!

將我的瀏覽器指向http://192.168.100.171/typotest/public/會導致錯誤 500,並在 apache-log-file 中出現此錯誤:

[Sun Jun 28 12:21:35.232020 2020] [php7:error] [pid 10894] [client 192.168.100.143:53326] 
PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function TYPO3\\CMS\\Core\\Imaging\\IconFactory::__construct(), 0 passed in /var/www/html/typotest/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php 
on line 3423 and exactly 2 expected in /var/www/html/typotest/public/typo3/sysext/core/Classes/Imaging/IconFactory.php:71\nStack trace:\n#0 /var/www/html/typotest/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php(3423):
 TYPO3\\CMS\\Core\\Imaging\\IconFactory->__construct()\n#1 /var/www/html/typotest/public/typo3/sysext/core/Classes/TimeTracker/TimeTracker.php(242): 
TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\...')\n#2 /var/www/html/typotest/public/typo3/sysext/core/Classes/Error/ErrorHandler.php(162): 
TYPO3\\CMS\\Core\\TimeTracker\\TimeTracker->setTSlogMessage('Core: Error han...', 2)\n#3 [internal function]: 
TYPO3\\CMS\\Core\\Error\\ErrorHandler->handleError(2, 'fopen(/var/www/...', '/var/www/html/t...', 193, Array)\n#4
 /var/www/html/typotest/public/typo3/sysext/core/Classes/Log/Writer/Fi in /var/www/html/typotest/public/typo3/sysext/core/Classes/Imaging/IconFactory.php on line 71, referer: 
http://192.168.100.171/typotest/

這在上下文中沒有多大意義......

我對 TYPO3 版本 9 和 10 進行了相同的嘗試 - 結果相同。 此時 TYPO3 的 var/log 為空。

解決:我做了以下組合:

chown -R web-devel.www-data typotest
chmod -R g+s typotest

我必須將 php-fpm 實例設置為作為 web-devel 運行。 這似乎可以解決問題。 如果可以對此進行評估並將其添加到設置說明中,那就太好了...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM