Exploring the Power of PHP Selector Plugin: Tailoring PHP Versions for Enhanced Web Development

PHP Selector plugin

End-user interface allows end users to select and manage PHP extensions and options for the particular PHP version.

Go to cPanel → Software Section → Select PHP Version.

PHP Extensions page opens.

Here you can choose extensions for the particular PHP version, the current PHP version and reset to default.

To manage PHP options, click Switch to PHP options.

All changes are saved automatically.

  • allow_url_fopen. Allows PHP file functions to retrieve data from remote locations over FTP or HTTP. This option is a great security risk, thus do not turn it on without necessity.
  • display_errors. Determines whether errors should be printed to the screen as part of the output or if they should not be shown to a user.
  • error_reporting. The error reporting level.
  • file_uploads. Allows uploading files over HTTP.
  • include_path. The list of directories where scripts look for files (similar to system's PATH variable). To separate directories, use a colon (:) For example: .:/dir/inc:/usr/lib/php
  • log_errors. Tells whether to log errors. By default, errors are logged in the server's error log. Use the error_log directive to specify the path to your own log file.
  • mail.force_extra_parameters. Additional parameters for the mail() function used to send mail. For example, to use your custom Sendmail configuration: -C /dir/conf.cf
  • max_execution_time. The maximum time in seconds a script is allowed to run before it is terminated.
  • max_input_time. The maximum time in seconds a script is allowed to parse input data.
  • memory_limit. The maximum amount of memory in bytes a script is allowed to allocate. Set the value to -1 to have no memory limit (not recommended). Use shortcuts for byte values: K (kilo), M (mega), and G (giga). For example, 128M.
  • open_basedir. The list of directories used to limit the files that can be opened by PHP. If the file is outside the specified directories, PHP scripts will refuse to open it. To separate directories, use a colon. For example: /dir/upload:/usr/tmp.
  • post_max_size. The maximum size in bytes of data that can be posted with the POST method. Typically, should be larger than upload_max_filesize and smaller than memory_limit. Use shortcuts for byte values: K (kilo), M (mega), and G (giga). For example, 16M.
  • session.save_path. The directory where PHP writes session data (files). For example: /dir/tmp
  • short_open_tag. Allows the short form of the PHP open tag.
  • upload_max_filesize. The maximum size in bytes of an uploaded file. Use shortcuts for byte values: K (kilo), M (mega), and G (giga). For example, 128M.

PHP Selector. My Domains tab cPanel CloudLinux Manager 6.0.1-2

The My Domains tab contains a list of user’s domains to visualize which PHP Selector is used by domain.

A user can configure a domain to use CloudLinux OS Shared PHP Selector.

  • Click Use PHP Selector

  • Set a version in PHP Selector.

Note

If PHP-fpm is enabled for a domain the only administrator can set it to disable.

CloudLinux Manager options

You can change CloudLinux Manager settings for a server manually via cPanel/WHM or, if you have many servers, you can change CloudLinux Manager settings for them in the config file.

Changing settings manually

  • Log in to cPanel, go to WHM, choose CloudLinux OS Shared and click Options.
  • Change settings.

Changing settings in the config file

You can modify the following options in the config file /var/cpanel/cpanel.config directly for example via Puppet.

   

lve_hideextensions

Hides (when =1) range of php extensions for user in Select PHP version

lve_hideuserstat

Hides (when =1) LVE statistics in cPanel Stats Bar (UI)

lve_showinodeusage

Displays (when =1) used inodes in cPanel (UI)

lve_hide_selector

Turns off UI PHP Selector (Select PHP Version option)

lve_enablerubyapp

Displays (when =1) Ruby Selector in user’s interface (UI)

Note

It is not allowed to change lve_enablepythonapp option in the config file directly.

You can use cloudlinux-selector utility to change lve_enablepythonapp option:

cloudlinux-selector set --json --interpreter=python --selector-status=enabled

Or you can change it via WHM -> CloudLinux Manager -> Options -> Python Selector -> Python

After modifying the config files directly, you should execute the following command to apply changes:

/usr/share/l.v.e-manager/utils/dynamicui.py --sync-conf=all

Enjoyed this article? Stay informed by joining our newsletter!

Comments

You must be logged in to post a comment.

About Author

Hi! This is Abdul Rehman. I am a 22-year-old content writer. I am a very passionate and responsible writer. I like to write on biological terms mostly. I also write content on various websites, such as http://www.mtlogisticsgroup.com http://www.alliancecaresupport.com & https://pits.pk