Skip to content
WasFor
Go boela gae
Tokomane/Phanele ya modirisi

Nako ya go dira ga PHP

Lefelo lengwe le lengwe le dira ka mofuta wa PHP o o o tlhophang. Mo godimo ga mofuta, WasFor e go letla go phimola ditaelo tsa php.ini ka bongwe ka saete ntle le go ama porofaele ya sefara ka bophara.

Tlhopha mofuta

Diwebosaete → saete → Dipeakanyo → Mofuta wa PHP o thathamisa mefuta e kentsweng noutu. Go e fetola go kwala gape sokete ya FPM ya vhost mme go laisa gape fela letamo leo — mafelo a mangwe a nna a direla.

text
PHP 8.1   Legacy applications
PHP 8.2   Current LTS-style choice
PHP 8.3   Recommended default

Tshwantsha mofuta o letlhomeso la gago le o bolelang. Go dirisa letlhomeso la segompieno mo nakong ya bogologolo ya go dira ke selo se se tlwaelegileng se se bakang diphoso tsa 500 tse di sa itsiweng morago ga go fuduga.

Kafa diphetolo di dirang ka gone

Dikarolo tse tharo di kopana ka nako ya go dira:

TlhatlhaganoMongweSekai
Porofaele ya sefaraMotsamaisiWFP0X
Diphimolo tsa saeteMorekiWFP0X
KopoWFP0XGo baakanngwa ga sekoupu sa kopo

Taelo e ruiwa go fitlha saete e e seta. Boleng jo bo phimotsweng jwa null kgotsa selotlolo se se tlogetsweng bo kaya "tswelela o rua". Seno se dira gore go babalesege go fetola sefara ya thulaganyetsoruri moragonyana ntle le go gakgamatsa lefelo lengwe le lengwe.

Ditaelo tse di tshegediwang

TaeloTlhatlhamanoTlhokomologoDintlha
WFP0X64M - 1G128ME amogela megatlana ya M/G
WFP0X30 – 30060Metsotswana; 0 ga e a letlelelwa
WFP0X30 – 300, -160-1 e kaya e e senang selekanyo
WFP0X2M - 512M64ME tshwanetse go nna ≤ post_max_size
WFP0X2M - 512M64ME tshwanetse go nna ≥ bogolo jwa go laisa
WFP0X1000 – 100001000Godisetsa diforomo tse dikgolo
WFP0XOn / OffWFP0XBoloka Off e le mo tlhagisong
WFP0Xdipalo kgotsa E_*WFP0XE amogela E_ALL & ~E_DEPRECATED
WFP0XLeina la IANAWFP0Xsk WFP0X
WFP0X1440 – 864001440Metsotswana

Netefatso e diragala pele ga sengwe se kwalwa. Boleng jo bo kwa ntle ga selekanyo bo ganwa ka phoso ya maemo a tshimo; ga e ke e tshwarwa ka tidimalo.

Laola diphimolo mo phaneleng

  1. Bula lefelo → PHP.
  2. Fetola Phimola go bapa le taelo.
  3. Tsenya boleng o bo o boloka.
  4. Netefatsa phetogo mo kholomong ya E a atlega.

Phanele e totobatsa ditlhagiso tse di jaaka post_max_size e nnye go feta upload_max_filesize, e e neng e tla kgaola dilaiso ka tidimalo.

Laola diphetolo ka API

http
GET /api/user/sites/42/php/settings
Authorization: Bearer <access-token>
json
{
  "ok": true,
  "data": {
    "php_version": "8.3",
    "runtime": "fpm",
    "supported": ["memory_limit", "max_execution_time", "upload_max_filesize"],
    "inherited": { "memory_limit": "128M", "max_execution_time": "60" },
    "overrides": { "memory_limit": "256M" },
    "effective": { "memory_limit": "256M", "max_execution_time": "60" },
    "limits": { "memory_limit": { "min": "64M", "max": "1G" } },
    "warnings": []
  }
}

Ntšhwafatsa diphetolo ka selo se se sa felelang; dinotlolo tse o di tlogetseng di boloka seemo sa tsone sa ga jaana:

http
PUT /api/user/sites/42/php/settings
Content-Type: application/json

{ "overrides": { "memory_limit": "256M", "display_errors": "Off" } }

Go emisa go phimola taelo, romela null:

json
{ "overrides": { "memory_limit": null } }

Seta gape phimolo nngwe le nngwe:

http
POST /api/user/sites/42/php/settings/reset

Lenaane la dikatoloso tse di leng teng mo mofuteng o o tlhophilweng:

http
GET /api/user/sites/42/php/extensions

Dintlha tsa tiriso

  • Diphetolo di kwalelwa mo karolwaneng ya php.ini ya saete nngwe le nngwe, e seng mo faeleng ya lefatshe lotlhe.
  • max_execution_time ga e akaretse nako e e dirisitsweng mo go thibeleng megala ya tsamaiso; dirisa modiri wa mola mo ditirong tse ditelele.
  • upload_max_filesize le post_max_size di tshwanetse go tsamaya mmogo. Seta post_max_size e kgolo go se kae.
  • Morago ga go fetola error_reporting, tlhagisa gape kgang mme o tlhole pegelo ya phoso ya saete; display_errors e ama fela mmele wa karabo.
  • Matangwana a FPM a laisiwa gape ka bontle. Dikopo tsa mo sefofaneng di felela ka thulaganyo ya bogologolo.

Amana

E tlhabolotswe labofelo: 2026-12-01