• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Contribution Tutorial: Installing PHP 5.4.29 and PEAR on Parallels Plesk 11.5/Centos 6.5

Has this tutorial helped you?

  • Partially

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    1

TreeProLtd

New Pleskian
The other day I purchases a Linux based dedicated virtual server from a hosting company, having come from my own development PC what I had been using as a server running Apache, PHP and MySQL.

With my hosting provider, out of the box you get Parallels Plesk 11.5 and Centos 6.5 what has PHP 5.3.3 without PEAR support. Thus I am making this guide explaining how to install PHP 5.4.29 with PEAR over the default PHP 5.3.3 without PEAR support.

For this tutorial you will need SSH access to the root of your dedicated server as well as general root file access. I also recommend you install pear first then PHP 5.4 as was what I did.



Installing PEAR:

Step 1) Open SSH client, login and change to the directory /usr/share

Step 2) Create a folder named pear in /usr/shares making it has 0755 permissions

Step 3) Change to the directory (The folder you have just created)

Step 4) Install pear in this directory by using the following command yum install php-pear

Step 5) Open php.ini in /etc and add the following line: include_path = "/usr/share/pear" to your php.ini file

Step 6) Open up Parallels Plesk Panel and under your domin/s php settings, for open_basedir add /usr/share/pear:/var/www/vhosts as a custom value.

Step 7) Restart apache and paste the following code below into a php file named pear.php and save it to your local web root.

Code:
<?php   require_once 'System.php';   var_dump(class_exists('System', false));     ?>

Step 8) In your web browser browse to yourdomian.tld/pear.php and if everything is set up correctly you should see bool(true) displayed.
(Note any php info file you have will still show --without-pear, just means PHP was not complied with it by default.)

Step 9) If step 8 is successfully, you have installed pear properly. You can now install pear modules at any time using the following command: pear install modulename
If step 8 is unsuccessful, make sure that the include path in your php.ini file matches the location of pears System.php file what should be located and found in /usr/share/pear


Installing PHP 5.4.29

Step 1) Open your SSH client, login and install the following repository's using the following commands

1. wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2. wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

3. sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Step 2) Open the file remi.repo under /etc/yum.repos.d

Step 3) In the file you have just opened (remi.repo); under the [remi] section, change enabled=0 to enabled=1 and save and close the file. (Note [remi] is the first section in the file!)

Step 4) Upgrade to PHP 5.4.29 using the following command: yum install php

Step 5) Open the file my.cnf under /etc and add the following under the [mysqld] section: innodb_use_native_aio=0 , and then save and close the file

Step 6) Restart the services httpd, mysqld and psa. You should now have PHP 5.4.29 installed and operating. For any errors you get, check the mysql error log at: /var/log/mysqld.log


Hope this tutorial helps;

Regards: Tree Pro Ltd
 
Thank you very much for this tutorial!
I just moved it to more appropriate place.
 
Back
Top