繁体   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