↑ ↓ select, Enter open, Esc close

PHP

Check PHP versions, PHP-FPM pools, modules and settings. Important on servers that run several PHP versions side by side.

14 one-liners: 10 harmless, 4 caution, 0 destructive

All PHP one-liners

Check all PHP files in a directory for syntax errors

$find /var/www/vhosts/example.com/httpdocs/wp-content/themes -name '*.php' -exec php -l {} \; 2>&1 | grep -v '^No syntax errors'
harmless

Check Composer packages for known vulnerabilities

$composer audit --working-dir=/var/www/vhosts/example.com/httpdocs
harmless

Check PHP OPcache settings

$php -i | grep -E '^opcache\.(enable|enable_cli|memory_consumption|max_accelerated_files|validate_timestamps|revalidate_freq) '
harmless

Check the current value of a PHP setting

$php -i | grep -i memory_limit
harmless

Check whether a PHP extension is loaded

$php -m | grep -i imagick
harmless

Count PHP-FPM processes per pool

$ps -eo args | grep '[p]hp-fpm: pool' | awk '{print $NF}' | sort | uniq -c | sort -rn
harmless

More power on the server

Does the optimization reach your visitors?

Faster database, more RAM, better caching: GENLOC.SEO measures whether it shows up in PageSpeed and Core Web Vitals. Free, for mobile and desktop.

by GENLOC.NETWORK, the team behind myline.de

Install Composer dependencies for production

$composer install --no-dev --optimize-autoloader --working-dir=/var/www/vhosts/example.com/httpdocs
caution

List all installed Plesk PHP versions

$for p in /opt/plesk/php/*/bin/php; do echo "$p: $($p -r 'echo PHP_VERSION;')"; done
harmless

Reload PHP-FPM for a Plesk PHP version

#systemctl reload plesk-php83-fpm
caution

Run a PHP script once without a memory limit

$php -d memory_limit=-1 /var/www/vhosts/example.com/httpdocs/import.php
caution

Run a PHP script with a specific Plesk PHP version

$/opt/plesk/php/8.3/bin/php /var/www/vhosts/example.com/httpdocs/cron.php
caution

Show all PHP-FPM services and their status

$systemctl list-units --type=service --all 'php*-fpm*' 'plesk-php*-fpm*'
harmless

Show the loaded php.ini files

$php --ini
harmless

Show the PHP version on the command line

$php -v
harmless

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.