Conas a shocraíonn CWP7 an teorainn ama leathnaithe?Réitigh earráid Nginx 504 Gateway

Nuair a bhíonn muid ar an bhfreastalaí CWP7.proWordPress时 ,使用Breiseán WordPressComhráGPT AI Nuair a Cumhacht: Pacáiste AI Comhlánaigh, feictear an teachtaireacht earráide seo a leanas"It appears that your web server has some kind of timeout limit., rud a chiallaíonn nach bhfuair Geata CWP freagra tráthúil ón bhfreastalaí nó an t-iarratas in aghaidh an tsrutha.

Conas a shocraíonn CWP7 an teorainn ama leathnaithe?

Ní gá do leagan saor in aisce CWP7 ach an 2 shocrú seo a leanas a mhodhnú:

  1. Athraigh luach am istigh na socruithe seachfhreastalaí
  2. athraigh default_socket_timeout

1. Athraigh luach am istigh na socruithe seachfhreastalaí

编辑 /etc/nginx/proxy.inc comhad, modhnaigh an luach teorainn ama seo a leanas go 600 ▼

proxy_connect_timeout 600s;
proxy_send_timeout 600;
proxy_read_timeout 600;

2. Athraigh default_socket_timeout

Painéal Rialúcháin CWPCliceáil ar an taobh clé → Socruithe PHP → Cumraíocht PHP.ini ▼

Conas a shocraíonn CWP7 an teorainn ama leathnaithe?Réitigh earráid Nginx 504 Gateway

nó in eagar /usr/local/php/php.ini comhad, cuardaigh"default_socket_timeout", arna mhodhnú go 600 ▼

default_socket_timeout 600

Leagan íoctha gairmiúil CWP7 Pro, ní mór duit an comhad cumraíochta a mhodhnú

Má úsáideann tú an leagan íoctha de CWP7 Pro, b'fhéidir go mbeadh ort an chumraíocht PHP-FPM a athrú freisin:

1. Suíomh réamhshocraithe:

/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. Cuir na luachanna seo a leanas leis an gcomhad 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. Cuir an luach seo a leanas leis an gcomhad 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. Athraigh an t-ábhar seo a leanas:

# 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
  • TABHAIR FAOI DEARA: Ná athraigh ach luachanna nach bhfuil marcáilte ach i gorm.

Anois cuirimis athróg fastcgi_read_timeout i gcumraíocht óstach fíorúil Nginx.

Má úsáideann tú óstáil PHP-FPM cuir leis (is féidir leat 600s a úsáid):

# 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;

Má úsáideann tú PHP-CGI, bain úsáid as a chomhad 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;

Má úsáideann tú roghnóir 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
  • Ag an bpointe seo, ba cheart an fhadhb a réiteach.

Tá súil agam Blag Chen Weiliang ( https://www.chenweiliang.com/ ) Roinnte "Conas a shocraíonn CWP7 síneadh a chur leis an teorainn ama?"Réitigh Earráid Geata Nginx 504", cabhróidh sé leat.

Fáilte romhat nasc an ailt seo a roinnt:https://www.chenweiliang.com/cwl-30321.html

Fáilte chuig cainéal Telegram de bhlag Chen Weiliang chun na nuashonruithe is déanaí a fháil!

🔔 Bí ar an gcéad duine a gheobhaidh an "Treoir Úsáide Uirlisí AI Margaíochta Ábhair ChatGPT" luachmhar san eolaire barr na gcainéal! 🌟
📚 Tá luach ollmhór sa treoir seo, 🌟 Seo deis annamh, ná caill é! ⏰⌛💨
Roinnigí agus más maith libh!
Is iad do chomhroinnt agus do thaitin ár spreagadh leanúnach!

 

发表 评论

Ní fhoilseofar do sheoladh ríomhphoist. Úsáidtear réimsí riachtanacha * Lipéad

scrollaigh go dtí an barr