The most impactful php.ini change is max_execution_time. JekCMS's image processing pipeline can take 3–8 seconds per upload for large files, and the default on many shared plans is 30 seconds — enough for a single image, not enough for batch uploads. Set it to 90 seconds. The second critical value is memory_limit: 256MB is the practical minimum; 512MB is safer for sites with active media operations.

OPcache: The Silent Performance Killer

opcache.memory_consumption should be at least 128MB. Many shared hosting control panels configure this to 64MB, which causes frequent cache invalidation and is often the root cause of intermittently slow page loads that are difficult to reproduce. You can check current usage by creating a temporary PHP file that calls var_dump(opcache_get_status()).

MySQL Query Cache Conflict

For the database, disable MySQL's built-in query cache (query_cache_type=0 if your host allows it) and rely on JekCMS's application-level query cache instead. The two caching layers can produce inconsistent results when both are active. If you cannot modify MySQL settings, set QUERY_CACHE_ENABLED=false in your JekCMS environment file to disable the application cache and let MySQL handle caching alone.

Verifying GZIP and Browser Cache

Verify GZIP compression and browser caching are active with: curl -H "Accept-Encoding: gzip" -I https://yoursite.com/. The response should include Content-Encoding: gzip. If it does not, your host may require activating mod_deflate from the control panel. Without GZIP, HTML responses are typically 3-5x larger than they need to be.

Essential php.ini Settings Reference

Most shared hosts allow overriding php.ini values via a local .user.ini file in the site root. Here is the recommended configuration:

; .user.ini (place in site root)
max_execution_time = 90
memory_limit = 256M
upload_max_filesize = 32M
post_max_size = 48M
max_input_vars = 5000
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 10000
opcache.revalidate_freq = 60

Why These Specific Values

  • upload_max_filesize = 32M — accommodates high-resolution photographs before AVIF conversion; converted output is typically 80-90% smaller
  • post_max_size = 48M — must exceed upload_max_filesize by at least 33% for base64 encoding overhead in multipart form submissions
  • max_input_vars = 5000 — the admin bulk editor can submit 50+ fields per post when editing metadata, categories, and SEO settings simultaneously
  • opcache.revalidate_freq = 60 — checks for file changes once per minute instead of on every request, reducing disk I/O by approximately 40%

.htaccess Performance Rules

The .htaccess file is where most shared hosting performance gains come from. JekCMS ships with a default that includes GZIP and cache headers, but many hosts strip these during deployment.

<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType image/avif "access plus 1 year"
 ExpiresByType image/webp "access plus 1 year"
 ExpiresByType text/css "access plus 1 year"
 ExpiresByType application/javascript "access plus 1 year"
 ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

Database Connection and Query Monitoring

JekCMS opens a single PDO connection per request and reuses it for all queries. On a typical page load this means 8-15 queries through one connection rather than separate handshakes. Enable QUERY_LOG=true in the environment file to log every query with execution time. Any single query taking more than 50ms indicates a missing index. The most common offender is post_meta lookups without the compound index — adding INDEX(post_id, meta_key) typically reduces queries from 40-80ms to under 2ms.

Cron Jobs on Shared Hosting

JekCMS uses scheduled tasks for cache cleanup, session garbage collection, and post publishing. Set up at minimum:

  • */15 * * * * — publishes scheduled posts every 15 minutes
  • 0 3 * * * — cleans expired cache and sessions at 3 AM daily

If your host does not support cron jobs, enable PSEUDO_CRON=true in the environment file. This triggers pending tasks on regular page views with a 1% probability, adding approximately 20ms to those requests.

File Upload Limits and Media Processing

Three php.ini directives control file uploads: upload_max_filesize, post_max_size, and max_file_uploads. Set upload_max_filesize to at least 20M for comfortable image uploading. The post_max_size must be larger than upload_max_filesize — we recommend 25M. The overlooked max_file_uploads defaults to 20 on most hosts, which limits batch media imports. For sites using the n8n automation pipeline, increase this to 50.

Error Logging on Shared Hosting

Most shared hosts disable display_errors in production, which is correct. However, you still need error logging. Add these to your .user.ini:

log_errors = On
error_log = /home/username/logs/php_error.log
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

Check this log file after every deployment. Common issues on shared hosting include undefined constant warnings from missing .env files and permission errors on the cache/ directory. The log file grows unbounded on most hosts, so add a cron job to rotate it monthly or truncate entries older than 30 days.

SSL and HTTPS Enforcement

Every shared hosting plan now includes free SSL via Let's Encrypt or AutoSSL. JekCMS requires HTTPS in production.

Add the redirect rule early in your .htaccess — before any rewrite rules — to avoid redirect chains that waste the visitor's first request. A common mistake is placing the SSL redirect after the trailing slash rule, which causes two sequential redirects instead of one. The correct order is: SSL redirect first, then www/non-www normalization, then trailing slash rules, then application routing.