Tag Archives: Plesk

How to change default PHP version in plesk

How to change default PHP version in plesk

In this article, I am referring to change default php version in plesk. In latest plesk versions are come with all the php versions installed ( we have the option to install all the php versions ). So no need to install a separate php in the server for setting the default PHP to the latest version. Creating symlink and some additional commands to bring the default handler to the required version.

Here is the environment in which the command worked.

Plesk Version : 17.5.3 CentOS 7

List the php handlers

/usr/local/psa/admin/bin/php_handlers_control --list

Verify the default php version.

php -v

Check the PHP version 5.6

/opt/plesk/php/5.6/bin/php -v

Find the default php binary

which php

Backup the php, php-cgi and php-fpm binaries.

mv /usr/bin/php /usr/bin/php.backup
mv /usr/bin/php-cgi /usr/bin/php-cgi.backup
mv /sbin/php-fpm /sbin/php-fpm.backup

Create symlink from php 5.6 binaries

ln -s /opt/plesk/php/5.6/bin/php /usr/bin/php
ln -s /opt/plesk/php/5.6/bin/php-cgi /usr/bin/php-cgi
ln -s /opt/plesk/php/5.6/sbin/php-fpm /sbin/php-fpm

You can set symlink from any other php version installed in the server. Following are the php bnaries for other versions, find the same for php-cgi and php-fpm too.

/opt/plesk/php/5.3/bin/php 
/opt/plesk/php/5.4/bin/php 
/opt/plesk/php/5.5/bin/php
/opt/plesk/php/5.6/bin/php
/opt/plesk/php/7.0/bin/php 
/opt/plesk/php/7.1/bin/php
/opt/plesk/php/7.2/bin/php

Once the symlink is created, the php version will show the new version we set. You can check it using the following command.

php -v

Next option is to update the plesk database with the changed versions. The reread option will update plesk database with the new versions.

/usr/local/psa/admin/bin/php_handlers_control --reread

After that reconfigure all the domains or the domains using the default php versions. And proceed with a service restart.

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
service httpd restart

Once this is completed, the sites will load with new php version.

Note: Make sure to do this by a qualified technician.

If you need us to do these changes for your server, please get it touch without support

14Feb/18

MagicSpam Extension Installation fails in Plesk 17

Recently we faced the below error while trying to install MagicSpam free version via plesk interface and got installed via command line using the rpm from the plesk download section. Since the plesk download section had too old version and plesk was showing an upgrade option and free version was not working (which I installed from rpm available at plesk )

Error while trying to install / upgrade from plesk interface is the below 
Failed
 Installation of extension has failed
 
 Execution of /usr/local/psa/tmp/modulehfmXQh/plib/scripts/pre-install.php failed with exit code 1 and the output:
 Failed to find operating system package manager rpm or dpkg.
 Contact [email protected] with full details of your installation for assistance.

Normal rpm installation and yum install was working fine. Continue reading

07Nov/15

Getting nginx disabled message while trying to start nginx service in plesk.

Sometimes we get the following error message, even if nginx is enabled in plesk.

[[email protected] ~]# /etc/init.d/nginx start
Not starting nginx as it is disabled in config

You can confirm the nginx service is enabled in the server using the following commands.

[[email protected] ~]# /usr/local/psa/admin/sbin/nginxmng -s
Enabled
[[email protected] ~]# chkconfig --list | grep nginx
nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off

Try enablng nginx as root from the terminal will fix the issue.

[[email protected] ~]# /usr/local/psa/admin/sbin/nginxmng -e
[[email protected] ~]# /etc/init.d/nginx status
nginx (pid  9873) is running...

Note: The enable/disable operations for the Reverse Proxy Server (Nginx) listed above do not just start and stop the Nginx service. They also switch the web server configuration for all the domains in Plesk (Nginx and Apache combination or just an Apache web server).

13Nov/13

[ERROR] /usr/sbin/mysqld: Can’t open file

 

I got this error while migrating  huge amount of accounts from one cpanel server to  another.

[ERROR] /usr/sbin/mysqld: Can’t open file: ‘./dbname/tablename.frm’ (errno: 24)

errno: 24 means there is too many open files.  There is a mysql variable named “open_files_limit"  which shows how many open files are allowed in mysql by default. We cannot update this valuse using “Set”  command as this variable is a read only variable.

Continue reading

13Nov/13

How to change the Notifications Email’s Subject in Plesk.

Last day one of client asked me about this and on checking I can see the pre defined notification email has edit option for the body but not for the Subject.

To get this done, we may need to access the plesk database and change the Subject of the desired notification from “psa.notification” table

Before you start working on this, always take a mysqldump for “psa” so that if any thing goes wrong, you can simply restore from the backup.

Continue reading

02Oct/13

How to check a website in a remote server before DNS change

In all migrations, we may wish to check the domain’s functionality and fix any errors preset  to make the dns change smoother and perfect. So just thought to add this in our blog too 🙂

Some control panel offer site preview, especially Plesk using which we can take a look on domain  hosted in that domain. But in others like cPanel, Directadmin and those without any control panels, we may need to check this using  local hosts file or by changing the A record on a temporary basis.

Best method is to check websites using your local “hosts” file in your PC / Laptop. Below is the steps using which one can test a website hosted in a remote server without changing the name server.

1.  Locate the hosts file in your computer. Typically it is in one of the following locations:

Windows NT/2000/XP/2003/Vista/7   —     C:\windows\system32\drivers\etc\hosts
Windows 95/98/Me                                         —     C:\windows\hosts

Continue reading

26Sep/13

Mail bouncing from Microsoft’s Exchange email service in Plesk

Mails from microsoft exchange email services are failed in plesk (qmail). Upon investigation we found that the grey list filter in plesk 10 is blocking server that are on “dsl|pool|broadband|hsd” address ranges. In this case it would be Microsofts cloud anti-spam service that is on “pool” addresses.

Some Microsofts cloud anti-spam servers are;

co9outboundpool.messaging.microsoft.com
db8outboundpool.messaging.microsoft.com
db9outboundpool.messaging.microsoft.com
am1outboundpool.messaging.microsoft.com

Log entries are like this Continue reading