N
N
Nixin7772020-06-04 12:50:46
PHP
Nixin777, 2020-06-04 12:50:46

The script does not work to the end when writing to a file. Why?

There is a vagrant (virtualbox) box - homestead/laravel ( https://laravel.com/docs/7.x/homestead).
It runs a Symfony project.
In nginx config -

server {
    listen 80;
    listen 443 ssl http2;
    server_name test.local;
    root "/home/vagrant/test.local/public";

    index index.html index.htm index.php;

    charset utf-8;



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

        fastcgi_read_timeout 99999999;
        fastcgi_connect_timeout 99999999;
        proxy_read_timeout 99999999;
        proxy_connect_timeout 99999999;
        proxy_send_timeout 99999999;
        send_timeout 99999999;
    }

    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/test.local-ssl-error.log error;

    sendfile off;

    # DEV
    location ~ \.php(/|$) {
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        fastcgi_read_timeout 99999999;
        fastcgi_connect_timeout 99999999;
        proxy_read_timeout 99999999;
        proxy_connect_timeout 99999999;
        proxy_send_timeout 99999999;
        send_timeout 99999999;

        #fastcgi_intercept_errors off;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 8 128k;
    }

    location ~ /\.ht {
        deny all;

        fastcgi_read_timeout 99999999;
        fastcgi_connect_timeout 99999999;
        proxy_read_timeout 99999999;
        proxy_connect_timeout 99999999;
        proxy_send_timeout 99999999;
        send_timeout 99999999;

    }

    ssl_certificate     /etc/nginx/ssl/test.local.crt;
    ssl_certificate_key /etc/nginx/ssl/test.local.key;
}


/etc/php/7.4/fpm/php.ini contains
max_execution_time = 9999999
max_input_time = 9999999
memory_limit = 1024M


/etc/php/7.4/fpm/pool.d/www.conf does not specify request_terminate_timeout.
Everything is empty in the logs, I noticed that even the logs do not add (in the screenshot)
5ed8c290264d6395363208.jpeg
stupid break

The script itself executes a cycle - creates an excel file (PhpSpreadsheet) and writes to it line by line. The file is created in public/files. The rights to this folder are 777. In general, everything is written and created, but cut off.

set_time_limit(0) in script doesn't help. Generally a help.

UPDATE--------------------------------
Also added to nginx, but it didn't change the situation :
fastcgi_buffer_size 1024k;
fastcgi_buffers 16 1024k;


UPDATE------------------------
Uploaded to the hosting, the same thing only the execution time is different . It still gets cut off.
The hosting is also nginx.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question