Sut mae CWP7 yn gosod y terfyn amser estynedig?Datrys gwall Porth Nginx 504

Pan fyddwn ni ar y gweinydd CWP7.proWordPress时 ,使用Ategyn WordPressSgwrsGPT AI Pan Pŵer: Pecyn AI Cwblhau, mae'r neges gwall ganlynol yn ymddangos"It appears that your web server has some kind of timeout limit., sy'n golygu na chafodd Porth CWP ymateb amserol gan y gweinydd neu'r cymhwysiad i fyny'r afon.

Sut mae CWP7 yn gosod y terfyn amser estynedig?

Dim ond y 7 osodiad canlynol y mae angen i fersiwn am ddim CWP2 eu haddasu:

  1. Addasu gwerth terfyn amser gosodiadau dirprwy
  2. newid terfyn amser rhagosodedig_soced

1. Addasu gwerth terfyn amser gosodiadau dirprwy

编辑 /etc/nginx/proxy.inc ffeil, addasu'r gwerth terfyn amser canlynol i 600 ▼

proxy_connect_timeout 600s;
proxy_send_timeout 600;
proxy_read_timeout 600;

2. Newid default_socket_timeout

Panel Rheoli CWPCliciwch ar y chwith → Gosodiadau PHP → Ffurfweddiad PHP.ini ▼

Sut mae CWP7 yn gosod y terfyn amser estynedig?Datrys gwall Porth Nginx 504

neu olygu /usr/local/php/php.ini ffeil, chwilio"default_socket_timeout", wedi'i addasu i 600 ▼

default_socket_timeout 600

Fersiwn taledig proffesiynol CWP7 Pro, mae angen i chi addasu'r ffeil ffurfweddu

Os ydych chi'n defnyddio'r fersiwn taledig o CWP7 Pro, efallai y bydd angen i chi hefyd newid y ffurfwedd PHP-FPM:

1. Lleoliad diofyn:

/opt/alt/php-fpm72/usr/etc/
/opt/alt/php-fpm72/usr/etc/php-fpm.d/
/opt/alt/php-fpm72/usr/etc/php-fpm.d/users/

2. Ychwanegwch y gwerthoedd canlynol i'r ffeil cwpsvc.conf:

# vi /opt/alt/php-fpm72/usr/etc/php-fpm.d/cwpsvc.conf

[cwpsvc]listen = /opt/alt/php-fpm72/usr/var/sockets/cwpsvc.sock
listen.owner = cwpsvc
listen.group = cwpsvc
listen.mode = 0640
user = cwpsvc
group = cwpsvc

;request_slowlog_timeout = 5s
;slowlog = /opt/alt/php-fpm72/usr/var/log/php-fpm-slowlog-cwpsvc.log
listen.allowed_clients = 127.0.0.1

pm = ondemand
pm.max_children = 1000
pm.process_idle_timeout = 300s
;listen.backlog = -1
request_terminate_timeout = 300s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
env[PATH] = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

3. Ychwanegwch y gwerth canlynol i'r ffeil nobody.conf:

# vi /opt/alt/php-fpm72/usr/etc/php-fpm.d/users/nobody.conf

[nobody]listen = /opt/alt/php-fpm72/usr/var/sockets/nobody.sock
listen.allowed_clients = 127.0.0.1

listen.owner = nobody
listen.group = nobody
listen.mode = 0660
user = nobody
group = nobody

;request_slowlog_timeout = 15s
;slowlog = /opt/alt/php-fpm72/usr/var/log/php-fpm-slowlog-nobody.log

pm = ondemand
pm.max_children = 1000
pm.max_requests = 6000
pm.process_idle_timeout = 300s

;listen.backlog = -1
request_terminate_timeout = 300s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
env[PATH] = /usr/local/bin:/usr/bin:/bin

4. Newid y cynnwys canlynol:

# vi /opt/alt/php-fpm72/usr/etc/php-fpm.d/users/datahead.conf

[datahead]listen = /opt/alt/php-fpm72/usr/var/sockets/datahead.sock
listen.allowed_clients = 127.0.0.1

;listen.owner = "datahead"
listen.group = "nobody"
listen.mode = 0660
user = "datahead"
group = "datahead"

;request_slowlog_timeout = 15s
;slowlog = /opt/alt/php-fpm72/usr/var/log/php-fpm-slowlog-datahead.log

pm = ondemand
pm.max_children = 1000
pm.max_requests = 4000
pm.process_idle_timeout = 300s

;listen.backlog = -1
request_terminate_timeout = 300s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /home/datahead/tmp
env[TMPDIR] = /home/datahead/tmp
env[TEMP] = /home/datahead/tmp
env[PATH] = /usr/local/bin:/usr/bin:/bin
  • SYLWCH: Newidiwch werthoedd sydd wedi'u marcio mewn glas yn unig.

Nawr, gadewch i ni ychwanegu newidyn fastcgi_read_timeout yng nghyfluniad gwesteiwr rhithwir Nginx.

Os ydych chi'n defnyddio gwesteiwr PHP-FPM yna ychwanegwch (gallwch ddefnyddio 600s):

# vi /etc/nginx/conf.d/vhosts/datahead.biz.ssl.conf

fastcgi_pass unix:/opt/alt/php-fpm72/usr/var/sockets/datahead.sock;
fastcgi_index index.php;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
include /etc/nginx/fastcgi_params;

Os ydych chi'n defnyddio PHP-CGI, yna defnyddiwch ei ffeil nginx.conf:

# Proxy settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
proxy_buffers 32 4k;

Os ydych chi'n defnyddio dewisydd PHP 2:

# sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 4096M,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^post_max_size =.*$,post_max_size = 4146M,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^memory_limit =.*$,memory_limit = 5120M,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^max_input_time =.*$,max_input_time = 300,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^max_execution_time =.*$,max_execution_time = 300,' /opt/alt/php72/usr/php/php.ini

# sed -i 's,^; max_input_vars =.*$,max_input_vars = 5000,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^max_file_uploads =.*$,max_file_uploads = 50,' /opt/alt/php72/usr/php/php.ini

# sed -i 's,^allow_url_fopen =.*$,allow_url_fopen = On,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^allow_url_include =.*$,allow_url_include = Off,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^short_open_tag =.*$,short_open_tag = Off,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^;date.timezone =.*$,date.timezone = Asia/Dhaka,' /opt/alt/php72/usr/php/php.ini

# sed -i 's,^display_errors =.*$,display_errors = Off,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^expose_php =.*$,expose_php = Off,' /opt/alt/php72/usr/php/php.ini
  • Ar y pwynt hwn, dylid datrys y broblem.

Blog Chen Weiliang Gobeithio ( https://www.chenweiliang.com/ ) Wedi'i rannu "Sut mae CWP7 yn gosod i ymestyn y terfyn amser terfyn amser?"Datrys Gwall Porth Nginx 504", bydd yn eich helpu chi.

Croeso i chi rannu dolen yr erthygl hon:https://www.chenweiliang.com/cwl-30321.html

Croeso i sianel Telegram o blog Chen Weiliang i gael y diweddariadau diweddaraf!

🔔 Byddwch y cyntaf i gael y "Canllaw Defnydd Offer AI Marchnata Cynnwys ChatGPT" gwerthfawr yng nghyfeiriadur uchaf y sianel! 🌟
📚 Mae'r canllaw hwn yn cynnwys gwerth enfawr, 🌟Mae hwn yn gyfle prin, peidiwch â'i golli! ⏰⌛💨
Rhannwch a hoffwch os hoffech chi!
Eich rhannu a'ch hoff bethau yw ein cymhelliant parhaus!

 

发表 评论

Ni fydd eich cyfeiriad e-bost yn cael ei gyhoeddi. 必填 项 已 用 * Label

sgroliwch i'r brig