Sites & PHP

PHP settings & extensions

Change php.ini values for every version, one version or one site, and turn extensions on and off.

التوثيق متاح باللغة الإنجليزية، مثل أوامر LaraMonster وواجهته.

Change php.ini values without editing files, at three levels: for every PHP version, for one version, or for one site. Each value shows what PHP uses right now and which level set it.

Three levels

LevelWhereApplies to
Every versionPHPSettings for every versionAll PHP versions LaraMonster runs. A version or a site can override each value.
One versionSettings on the version's row of the PHP pageSites and commands on that version. Overrides every version.
One siteSite panel → PHP tabOnly that site: in the browser and in its php, composer and artisan commands.

The most specific level wins: a site's value beats its version's, which beats every version, which beats the version's own php.ini. Leave a field empty to inherit. Under each field, Now: shows the value PHP actually uses, so you never have to guess.

Site settings never leak. A site with its own settings runs in its own PHP process, so a 2 GB memory_limit for one import-heavy project doesn't change any other site.

Common settings

The most-used values are listed first; search the list, or add any other setting by its php.ini name under Add another setting.

SettingTypical changeWhy
memory_limit512M or -1Imports, exports, big Composer installs
upload_max_filesize64MUploading files bigger than 2 MB
post_max_size64MMust be at least upload_max_filesize
max_execution_time120Slow reports or third-party calls in a request
display_errorsOnSee errors in the page while developing
date.timezoneAfrica/CairoDates in your own timezone outside Laravel

Example: allow 100 MB uploads for one site

  1. Open the site's PHP tab

    Sites → click the site → PHP.

  2. Set both values

    upload_max_filesize = 100M and post_max_size = 100M.

  3. Save

    The site's PHP process restarts with the new values in a second. Now: shows 100M for both.

Check it from the project folder; the shims use the same settings:

$ php -r 'echo ini_get("upload_max_filesize"), PHP_EOL;'
100M

Extensions

Click Extensions on a version's row of the PHP page to see its extensions, with what each one is for. What you can change depends on where that PHP came from:

PHPWhat you can do
LaraMonster's builds (macOS, Linux)Everything is built in (intl, sodium, GD, bcmath, zip, PDO drivers, OPcache…). The list shows what's included.
WindowsTurn bundled extensions on and off with a switch, and add Xdebug, Redis, APCu, igbinary, MongoDB, PCOV or MessagePack with one click; they're downloaded for your exact PHP version.
System PHPTurn on extensions that are installed but not enabled, and install popular ones with your package manager (apt, dnf, pacman, zypper or Homebrew). When there's no package, LaraMonster shows the pecl install command to use.

Xdebug

Xdebug slows every request, so LaraMonster turns it on per site: other sites stay fast. Turn it on from the Debugger, then start listening in your editor (VS Code: “Listen for Xdebug” on port 9003; PhpStorm: the telephone icon).

Code coverage

For php artisan test --coverage or Pest's --coverage, add PCOV; it's much faster than Xdebug for coverage.