Mohammedz.com

For Linux and Shell scripting.

Can’t Enable/Disable PHP Support for a Domain in Plesk

13 Comments


Plesk provides a feature to select/deselect PHP support for each domain. Sometimes, the check box to enable/disable PHP support is grayed out,  so the user won’t be able to use that feature. This happens if PHP is not installed or the installed PHP is not recognized by Plesk components. In most cases this happens if you have installed PHP manually (not using the rpm comes with Plesk).

You can see the installed PHP components in the following way:

Using Plesk control panel, click on Plesk–>server–>component info, you can see if the installed PHP is detected by the Plesk. The same details of installed (detected) components can be seen using mysql.

#mysql -u admin -p’cat /etc/psa/.psa.shadow’

mysql> use psa;
mysql> select * from Components;

If you see the value of php as not_installed, you probably have to edit the database to detect the currently installed PHP version. Follow the steps below to do this.

Findout the current PHP version:

#php -v

Then, edit the psa components table

#mysql -u admin -p’cat /etc/psa/.psa.shadow’

mysql> use psa;
mysql> update Components set version=”4.4.6″ where name=”php” limit 1;
mysql>\q

Restart plesk:

#/etc/init.d/psa stopall
#/etc/init.d/psa start

You will now be able to enable/disable PHP support for each domain.

Advertisements

13 thoughts on “Can’t Enable/Disable PHP Support for a Domain in Plesk

  1. Thanks for this article; my Plesk suddenly developed this feature, when before I could enable/disable at will.

    I found your article from Google, and ran through your steps above, and it seems to have worked.

    Thanks!

  2. Hi!
    interesting workaround for the blank PHP-Button. Thanks.
    Do you happen to know, if one can use this to make Plesk work with multiple versions of PHP, e.g. PHP4 and PHP5?

    Greetings.
    keyJ

  3. Hi KeyJ,

    Latest Plesk versions, starting from 8.1, support both php4 and php5. Once they are installed, the required version for each individual domain can be selected via Plesk control panel (Domains >> domain.tld >> Setup…)

    You should be able to use the above mentioned work around, if you find any of the “plesk components” are having wrong values.

    ~mohammed

  4. I have Plesk 9.2.3 and while the mysql update works, it doesn’t last, it reverts back after a while, either by adding a domain or by refreshing the component list.

    Any ideas? Might the data be in a file too?

  5. I haven’t worked on Plesk 9.2.x, but I think you should double check the psa components table after updating mysql.

    ~mohammed

  6. Hi, this did not seem to work for my, all of my components say not_installed for some reason, but everything seems to be working normall other than the ability to enable/disable PHP in the domain..

    Here is my post for more detail:
    http://forum.parallels.com/showthread.php?t=100978

    If you have any ideas it would be greatly appreciated. Thanks.

  7. I found that it only worked if I did NOT restart Plesk, and did not refresh the component list after updating the Components table – if I do any of those things, Plesk overrwrites my php setting back to not_installed.

  8. I’m having the same problem in Plesk 9, upgraded to php52, now plesk says no PHP is installed. I’ve attempted to make the mysql changes, but if anything is refreshed or if plesk needs to restart, I’m back to the same old problems. Has a permanent fix for Plesk 9 been found yet?

  9. I have the same problem of Brandon and Jonny.
    If i restart Plesk all goes back to not_installed.
    Please !!!

  10. Pleas update post if someone resolve.

  11. I have write a little workaround:
    Bash script runnin every 10 minutes :

    #!/bin/bash
    MYSQLPASS=$(cat /etc/psa/.psa.shadow)

    mysql -Ns -uadmin -p$MYSQLPASS -Dpsa -e ‘update Components set version=”5.2.17-1.ius.el5″ where name=”php” limit 1;’

    Put your right php version

  12. Thanks for the steps…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s