如何在Laravel Forge上部署CodeIgniter?

时间:2015-07-22 00:07:36

标签: codeigniter laravel-forge

我想在Laravel Forge平台上部署Codeigniter,因为我喜欢平台的简单性和自动部署性质。 我该怎么做?

2 个答案:

答案 0 :(得分:0)

这就是我做到的,以及我做过的问题。

问题1 因为Forge在Nginx上运行,而不是在apache上运行,所以任何Apache PHP指令都将被忽略。 (我认为)。所以,我遇到的主要问题是默认配置中的short_open_tag指令设置为'Off',这意味着这个PHP FPM CONFIGURATION

问题2

在特定于站点(不是服务器)的Nginx配置文件中替换

try_files $uri $uri/ /index.php?$query_string;

使用

try_files $uri $uri/ /index.php;

答案 1 :(得分:0)

此配置绝对适用于2019年5月在Laravel Forge上的Codeigniter

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name default;




root /home/forge/default/;

# FORGE SSL (DO NOT REMOVE!)
# ssl_certificate;
# ssl_certificate_key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'REPLACE WITH YOURS';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

#added tto try to get around the 'no input file specified' error
autoindex on;

index index.html index.htm index.php;

charset utf-8;

# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/default/server/*;

location / {
    #try_files $uri $uri/ /index.php?$query_string;
    try_files $uri $uri/ /index.php;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/default-error.log error;

error_page 404 /index.php;

location ~ \.php$ {
    include fastcgi.conf;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
}

location ~ /\.ht {
    deny all;
}

}