Latest blog entry

How to install PHP-Json module on a Linux Plesk server?

May 20, 2011    |   Posted by admin   |    Category: Installations, Plesk Management

To install/enable Json support for PHP on a Linux Plesk server, follow the below steps:

1. Install php-pear and gcc

# yum install php-pear gcc

2. Install json module

# pecl install json

3. Now, the json.so file is created under the php lib directory i.e. /usr/lib64/php/modules/ and needs to be called in the json.ini so PHP configuration could read it.

# cd /etc/php.d 
# echo "extension=json.so" >> json.ini

4. Once done, restart the httpd service

# /etc/init.d/httpd restart

This is it.

However, the other way is to manually install the php-json module. Follow the below steps:

1. Download the json package

# wget http://pecl.php.net/get/json-1.2.0.tgz

2. Untar and goto the newly created directory

# tar -zxf json-1.2.0.tgz 
# cd json-1.2.0

3. Create the configuration files and configure json

# phpize 
# ./configure

4. Create the installation file and install it

# make 
# make install

Once done, json.so will be created in /usr/lib64/php/modules/ directory and needs to be called by the php configuration directory

# cd /etc/php.d 
# echo “extension=json.so” >> json.ini

Restart the httpd service and check the php-json module by executing

# php -m | grep json

Note:  The manual installation method can be used on a plain Linux server as well, just the extension need to be added in the php.ini file directly.

Comments Off on How to install PHP-Json module on a Linux Plesk server?

Plesk StatInfo-> getProductVersion failed: file_get_contents () failed

May 15, 2011    |   Posted by admin   |    Category: Plesk Management

While accessing the Plesk control panel, you may encounter an error message as follows:

ERROR: PleskFatalException StatInfo-> getProductVersion failed
OR
ERROR: PleskFatalException StatInfo-> getProductVersion failed: 
file_get_contents () failed: mktime() 
[<a href='function.mktime'>function.mktime</a>]

The “Plesk getProductVersion failed ” message states that either the Plesk version file /usr/local/psa/version is empty AND/OR the plesk version in the ‘psa.misc’ table is incorrect. This is mostly caused due to a failed Plesk upgrade OR by removing/installing some Plesk modules.

To fix the issue do the following:

1. First, check the Plesk version installed on the server

# rpm -qi psa

note down the ‘version’ and ‘release’ values (these values will be different on your server).

Version : 9.5.3 Release : cos5.build95301122.20

now, check the OS installed on the server (for example, on CentOS)

# cat /etc/redhat-release 
CentOS release 5.5 (Final)

Using the above Plesk and OS info, insert a line as follows (your values will differ) in the /usr/local/psa/version file.

9.5.3 CentOS 5 95301122.20

Save the file and restart the psa serivce.

2. If the above fix doesn’t work, do the following

Check the current value of  Plesk in the psa.misc table.

mysql> select * from psa.misc where param='version';

If the value is not 0953 (example from my server), run the mysql update query to set the proper value. You should use the value that is returned by the ‘rpm -qi psa’  command on your server.

mysql> update psa.misc set val="0953" where param="version";

Exit and restart mysql. That is it.

Comments Off on Plesk StatInfo-> getProductVersion failed: file_get_contents () failed