Community

How to configure PHP in cPanel for optimal performance with phpListings.

Showing 1 of 1
How to configure PHP in cPanel for optimal performance with phpListings.
by Nicholas
2 months ago
N

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.

  •     Log in to your cPanel account.
  •     Locate and open the "Select PHP Version" or "MultiPHP Manager" option.
  •     Choose the latest stable version of PHP that is supported by phpListings.
  •     Click "Apply" or "Save" to update the PHP version for the selected domain name.

2. Adjust PHP Settings

You can do this by accessing the "MultiPHP INI Editor" or "PHP Configuration" section in cPanel.

a. Memory Limit:

  •     Navigate to the "MultiPHP INI Editor."
  •     Select the domain where phpListings is installed.
  •     Increase the memory limit to at least 256M or higher.
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

  •     Navigate to "Select PHP Version" or "MultiPHP Manager."
  •     Check the boxes for the above-mentioned extensions in the "Extensions" sub-menu.
  •     Save your changes.

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.

  •     Navigate to the "MultiPHP INI Editor."
  •     Add or adjust the following OPcache settings:
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".

Showing 1 of 1
pixel image