Nicholas
Support Dept.To configure PHP in cPanel for optimal performance of phpListings, you'll need to focus on several key areas including PHP version, memory limit, caching and other settings. Here’s a step-by-step guide:
1. Update PHP Version
Make sure you are using the latest version of PHP that is compatible with phpListings - PHP 8.1 or PHP 8.2.
2. Adjust PHP Settings
You can do this by accessing the "MultiPHP INI Editor" or "PHP Configuration" section in cPanel.
a. Memory Limit:
memory_limit = 256M
Important Note: We do not recommend setting the memory_limit above 512M. This setting controls the memory limit for each PHP process, and with multiple PHP processes running, a very high limit can cause instability.
b. Max Input Time:
Set the maximum input time (in seconds) to handle large POST (file upload) requests.
max_input_time = 60
c. Upload Max Filesize and Post Max Size:
Adjust these settings if phpListings requires handling large file uploads (logos, gallery images, PDF files), the following will allow 64Mb file uploads:
upload_max_filesize = 64M
post_max_size = 64M
d. Enable the allow_url_fopen directive:
This setting enables phpListings to open remote files for tasks such as importing listing logos and documents, checking backlink availability on listing websites, verifying that listing URLs exist using the built-in dead link checker, and getting reCaptcha verification responses.
allow_url_fopen = On
3. Enable PHP Extensions
Make sure all required PHP extensions are enabled for phpListings. Common extensions include: CURL, JSON, Mbstring, PDO, PDOMySQL, Intl, IonCube, ZIP, XML
4. Optimize OPcache
OPcache improves PHP performance by storing precompiled scripts bytecode in memory, thus eliminating the need for PHP to load and parse scripts on each request.
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
You can also enable Opcache as an extension, the procedure is described in the 3rd paragraph of this manual under "Enable PHP Extensions".