Installation TYPO3的composer安装导致http 500 简短描述

Installation TYPO3的composer安装导致http 500 简短描述,installation,composer-php,debian,typo3,Installation,Composer Php,Debian,Typo3,我尝试在Debian 10服务器上使用composer安装基本的TYPO3。按照我能找到的所有官方指示,会导致http错误500,服务器日志中没有(对我来说)有意义的内容 我首先在客户机服务器上遇到了这个问题,因此为了调试目的,我安装了一个全新的虚拟服务器,并遇到了完全相同的问题 我做了一件事,这可能会让一些知情人士找到解决方案: web-devel@typo-test:/var/www/html/typotest/public$ cp index.php test.php $ vi test

我尝试在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/”替换对
\uuuuu DIR\uuuu
的引用并不能改善情况

TYPO3第9版和第10版的情况都是一样的

我找不到任何关于这个问题的提及,这让我感到惊讶,因为它是一个直截了当的方法。我很乐意看到任何指向解决方案的指针,或者至少是调试提示


长描述 --Debian Gnu/Linux 10应用了所有补丁,服务器IP为192.168.100.171

--Apache/PHP/XML/MySQL已安装并正在运行

--根据需要设置先决条件

--准备数据库:

> 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

--我意识到,我没有最新的作曲家版本。建议的composer自我更新失败,因此我根据安装了composer

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

--下一步-根据安装类型3

--完美无瑕:

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!
然后

将我的浏览器指向会导致错误500,apache日志文件中有此错误:

[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版中也尝试了同样的方法-结果相同!
此时,Type3的var/log为空。

已解决:我执行了以下组合:

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

我必须将php fpm实例设置为作为web devel运行。这似乎奏效了。如果可以对其进行评估并将其添加到安装说明中,那就太好了…

更新:刚刚在CentOS 8的新安装上尝试了相同的操作-相同的行为…您是否尝试过通过安装工具清理缓存?在切换到新版本的composer和helhum/typo3控制台后,我们最近遇到了一个500错误。这在“/var/cache/code”中创建了一个名为“di”的文件夹,一旦我们对此进行深入研究,它就会工作。还没来得及弄清楚是因为作曲家还是控制台版本。谢谢!我试过了,但没用。我觉得还没到这一步。我可以在不改变行为的情况下重命名整个var文件夹……第二次更新:执行
chmod-R 750打字测试
似乎可以“解决”这个问题。似乎composer设置了一些权限错误。我们可以在另一台(托管)服务器上确认此行为。真不敢相信以前没人见过这个?
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!
[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/
chown -R web-devel.www-data typotest
chmod -R g+s typotest