TYPO3安装系统要求及配置
系统要求
TYPO3需要一个
Web服务器
,需要PHP
和MySQL数据库
系统。
-
TYPO3需要一个可以运行PHP 的Web服务器(
Apache/httpd
,Nginx
,Microsoft IIS
)。如果使用Apache Web服务器,则必须激活某些模块(例如mod_rewrite)。 -
TYPO3 V10 要求 PHP >= 7.2 <= 7.4 .对于PHP,需要几个PHP扩展,文档中会具体介绍扩展和配置。您可能要调整内存限制。
-
TYPO3可以与许多 数据库系统 一起使用(MariaDB> = 10.2 <= 10.3,Microsoft SQL Server,MySQL> = 5.7 <= 8.1,PostgreSQL,SQLite)。
-
如果要TYPO3自动执行 图像处理(例如缩放或裁剪),则需要在服务器上安装
GraphicsMagick
(1.3版或更高版本)或ImageMagick
(6版或更高版本)。(推荐GraphicsMagick
)
模块 | 介绍 |
---|---|
操作系统 | Linux,Windows或Mac或常见的云基础架构设置 |
WEB服务器 | Apache httpd,Nginx,Microsoft IIS,Caddy服务器 |
数据库 | MariaDB >= 10.0 <= 10.3, Microsoft SQL Server,MySQL >= 5.0 <= 5.7,PostgreSQL,SQLite |
硬件 | 最低1核CPU,2G内存,5M带宽;建议2核4G5M带宽 |
支持的浏览器 | Chrome (最新),Edge (最新),Firefox (最新),Internet Explorer >= 11,Safari (最新) |
PHP | PHP >= 7.2 <= 7.4 |
数据库环境
TYPO3与上述版本中的数据库管理系统一起使用。如果使用
MySQL
,必须启用InnoDB
引擎。
数据库权限
供TYPO3使用的数据库需要以下权限:
- SELECT, INSERT, UPDATE, DELETE
- CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
另外建议同时赋予以下权限:
- CREATE VIEW, SHOW VIEW
- EXECUTE, CREATE ROUTINE, ALTER ROUTINE
Web服务器环境
Apache
-
如果使用Apache作为Web服务器使用的话,请确保Web服务器配置
.htaccess
中的AllowOverride
包括Indexes
和FileInfo
。 -
在文件
.htaccess
中启用Apache模块mod_rewrite
:
模块 | 介绍 | 备注 |
---|---|---|
mod_alias: | Block access to vcs directories | (strongly recommended for security reasons). |
mod_authz_core: | Block access to specific files and directories | (strongly recommended for security reasons). |
mod_autoindex: | Used for disabling directory listings | (strongly recommended for security reasons). |
mod_deflate: | Used for compression, better performance. | |
mod_expires: | Adds HTTP headers for browser caching and better | performance |
mod_filter: | Used with mod_deflate. For Apache versions below | version 2.3.7 you don't need to enable mod_filter . |
mod_headers: | Used in combination with mod_deflate . |
|
mod_rewrite: | Enable human readable urls. | |
mod_setenvif: | Also used with mod_deflate . |
在安装过程中(首次安装),如果默认
.htaccess
文件不存在,则将其复制到项目的文档根文件夹中。
NGINX
NGINX服务用不了默认的
.htaccess
文件配置,所以需要自行去配置下.
The NGINX configuration has to be setup manually.
示例配置:
# Compressing resource files will save bandwidth and so improve loading speed especially for users
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
# *) Set $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'] = 9 for the Backend
# *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties
# config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
location ~ \.js\.gzip$ {
add_header Content-Encoding gzip;
gzip off;
types { text/javascript gzip; }
}
location ~ \.css\.gzip$ {
add_header Content-Encoding gzip;
gzip off;
types { text/css gzip; }
}
# TYPO3 - Rule for versioned static files, configured through:
# - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
# - $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename']
if (!-e $request_filename) {
rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ /$1.$3 last;
}
# TYPO3 - Block access to composer files
location ~* composer\.(?:json|lock) {
deny all;
}
# TYPO3 - Block access to flexform files
location ~* flexform[^.]*\.xml {
deny all;
}
# TYPO3 - Block access to language files
location ~* locallang[^.]*\.(?:xml|xlf)$ {
deny all;
}
# TYPO3 - Block access to static typoscript files
location ~* ext_conf_template\.txt|ext_typoscript_constants\.txt|ext_typoscript_setup\.txt {
deny all;
}
# TYPO3 - Block access to miscellaneous protected files
location ~* /.*\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|tsconfig|dist|fla|in[ci]|log|sh|sql|sqlite)$ {
deny all;
}
# TYPO3 - Block access to recycler and temporary directories
location ~ _(?:recycler|temp)_/ {
deny all;
}
# TYPO3 - Block access to configuration files stored in fileadmin
location ~ fileadmin/(?:templates)/.*\.(?:txt|ts|typoscript)$ {
deny all;
}
# TYPO3 - Block access to libraries, source and temporary compiled data
location ~ ^(?:vendor|typo3_src|typo3temp/var) {
deny all;
}
# TYPO3 - Block access to protected extension directories
location ~ (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ {
deny all;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_buffer_size 32k;
fastcgi_buffers 8 16k;
fastcgi_connect_timeout 240s;
fastcgi_read_timeout 240s;
fastcgi_send_timeout 240s;
fastcgi_pass typo3:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
PHP 环境
-
memory_limit
至少设置为 256M -
max_execution_time
至少设置为 30 (建议设置为240) -
max_input_vars
至少设置为 1500
PHP 扩展
PHP需要支持以下扩展。安装过程中会检查这些扩展的可用性。
以下扩展可能在安装php时自动安装
序号 | 扩展名 |
---|---|
1 | PDO |
2 | json |
3 | pcre >= 8.38 (Mac users: see warning a the end of this document) |
4 | session |
5 | xml |
5 | filter |
6 | hash |
7 | mbstring |
8 | SPL |
9 | standard |
以下扩展需要单独安装加载
序号 | 扩展名 |
---|---|
1 | fileinfo |
2 | gd |
3 | zip |
4 | zlib |
5 | openssl |
5 | intl |
6 | mysqli (if you use MySQL, MariaDB as DBMS) |
7 | postgresql (if you use PostgreSQL as DBMS) |
8 | sqlsrv (if you use SQL Server as DBMS) |
9 | sqlite (if you use SQLite as DBMS) |