Answer the question
In order to leave comments, you need to log in
Why is open_short_tag not working in Nginx?
Installed nginx, php5.6-fpm. Created a host config for nginx:
server {
listen 8080;
server_name test.local;
root /var/www/html/test;
index index.php;
access_log /logs/nginx/access.log;
error_log /logs/nginx/error.log;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~* ^.+\.(js|css|ttf|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|tar|bz2|pdf|doc|docx|rtf|xls|ppt|mp3)$ {
#access_log off;
#log_not_found off;
#expires 3d; # кеширование статики 3 дня
try_files $uri =404;
}
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~ .*\.php$ {
fastcgi_pass 127.0.0.1:9056;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* /\. {
deny all;
}
}
<?= ini_get('short_open_tag'); ?>
<? echo 'Hello'; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question