To install CentOS Web Panel (CWP) and configure it for PHP Selector, follow these steps:
Step 1: Connect to Your Server
Connect to your CentOS server via SSH using a terminal or an SSH client like PuTTY.
Step 2: Download and Install the CentOS Web Panel
Run the following command to download and install the CentOS Web Panel:
cd /usr/local/src
wget http://centos-webpanel.com/cwp-el7-latest
sh cwp-el7-latest
Step 3: Access the Control Panel
Once the installation is complete, you can access the control panel by navigating to https://your-server-IP:2031
a web browser. Log in with the provided credentials.
Step 4: Set Up PHP Selector
-
In the CWP control panel, go to
PHP Settings
under thePHP Selector
section. -
Here, you can choose the PHP versions you want to make available to your users.
-
Click on
Edit PHP Version
for the version you want to configure. -
You can select which PHP extensions you want to enable or disable for this version. Make sure to save your changes.
Step 5: Configure PHP Selector for Users
-
To allow users to select their PHP version, you need to set up PHP Selector for individual users:
-
Navigate to
User Accounts
>User List
. -
Select the user you want to configure.
-
In the user settings, go to
Web Template
and choosedefault
any other template that supports PHP Selector. -
Save the changes.
-
Step 6: Enable PHP Selector for Users
-
Go to
User Accounts
>User List
. -
Click on the user you want to enable PHP Selector for.
-
In the user settings, go to
Select PHP Version
. -
Here, the user can select the PHP version they want to use for their websites.
Step 7: Restart Apache
After making changes to the PHP settings, it's a good practice to restart Apache for the changes to take effect:
service httpd restart
Step 8: Verify PHP Selector
Create a simple PHP script to verify that the PHP Selector is working correctly. For example, create a file called info.php
with the following content:
phpinfo();
Place this file in your web directory (/var/www/html/
by default) and access it through a web browser. It should display information about the PHP version and configuration.
That's it! You've now installed CentOS Web Panel and configured PHP Selector for your server. Remember to keep your server and control panel up to date for security and performance improvements.