使用php7和nginx在CentOS 7上安装Typo3

时间:2016-06-30 16:22:46

标签: nginx centos typo3

我正在尝试在我的CentOS服务器上安装Typo3。 我想用php7和nginx运行它。

如果我用phpinfo做一个index.php就行了。在我将Typo3的索引更改为索引之后,它再次进行工作。

http://baddog.me/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/typo3/sysext/install/Start/Install.php

我的Nginx配置:

server {
server_name baddog.me;

listen       80;
root         /var/www/typo3/htdocs;
location ~* \.(?:jpg|css|js|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|json|woff)$ {
    expires 1M;
    add_header Cache-Control "public";
}

error_page 500 501 502 503 504 /500.html;

location = /500 {
    return 500;
}

location /500.html {
    internal;
}

location /robots.txt {
}

location /favicon.ico {
}

location ~ \.png {
    try_files $uri =404;
}

location / {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_param  SCRIPT_FILENAME  /var/www/typo3/htdocs/index.php;
    include        fastcgi_params;
}

}

我改变了php.ini中的一些参数。

抱歉我的英语不好。我希望得到帮助:) ty

1 个答案:

答案 0 :(得分:0)

为什么要将index.php仅作为传递给PHP的文件进行硬编码?

server {  
    listen *:8080;
    root /var/www/html;
    index index.php index.html index.htm;
    server_name php7;
    location / {
        try_files $uri $uri/ =404;
    }
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

        include fastcgi_params;
        fastcgi_pass unix:/var/run/php7-fpm.sock;
        fastcgi_read_timeout 300;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    }
}

检查portlisten),rootserver_name并根据需要采用它们。

还要确保所有文件都具有正确的安全标签(selinux),从而运行$ restorecon -rv /var/www/html