The Lazy Admin Blog

Home  /  CentOS • Litespeed  /  Compiling PHP 5.2 on a CentOS 7 LiteSpeed Server

Compiling PHP 5.2 on a CentOS 7 LiteSpeed Server

October 01, 2022 CentOS, Litespeed Leave a Comment

PHP 5.2 is deprecated a long time ago, but still, we had to fire up an old website on a CentOS 7 box using LiteSpeed. Although building PHP 5.2 from source should be supported, it doesn’t really work “out of the box” and some workarounds are needed.

Before we start, let’s start by installing missing packages (Others may be needed, depending on your server)

yum install autoconf213 libjpeg* libpng* mysql-devel

Start compile process:
Go to Litespeed admin -> actions -> compile php -> php 5.2 -> next

Paste this into configure parameters:

'--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--with-iconv' '--with-mysql' '--with-mcrypt' '--with-pdo' '--with-pdo-mysql' '--enable-ftp' '--enable-zip' '--with-curl' '--enable-soap' '--enable-calendar' '--enable-xml' '--enable-json' '--with-openssl' '--enable-bcmath' '--with-litespeed' '--with-libdir=/lib64

Click on “Build PHP 5.2”

Now to the tricky part! Before continuing the compile process, we need to apply a patch I found in github (with the courtesy of Konstantin Kelemen), From your server’s CLI, do the following –

Download the patch and apply it –

cd /usr/local/lsws/phpbuild/
wget https://gist.githubusercontent.com/konstantin-kelemen/f8b93428d2c4f57c590168da0a72d8fd/raw/8754ad5420e848bbeac1134bfdeabcdc1cfa2615/php-5.2.17.patch -O fixphp.patch
patch -p0 < fixphp.patch

Fix the autoconf (where XXXXXX are numbered for the correct script file)

vi buildphp_XXXXXXXX.x.install.sh

Paste this on line 2 (right after #!/bin/sh):

export PHP_AUTOCONF=/usr/bin/autoconf-2.13
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13

Run build script –

/usr/local/lsws/phpbuild/buildphp_manual_run.sh

Go back to the Litespeed admin window and monitor the output.
If it fails for example for missing packages (or any other fixable reason), you can fix what’s needed/missing and execute the build script again.

Tags: CentOS, litespeed
Previous Article
Next Article

Related Posts

  • Configure LiteSpeed Crawler

    October 5, 2022
  • Post-processing of the image failed likely because the server is busy.

    Post-processing of the image failed likely because the server is busy.

    September 30, 2022
  • LiteSpeed lsphp 7.4 zip Support

    LiteSpeed lsphp 7.4 zip Support

    September 30, 2022

Leave a Reply

Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search Our Blog

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
Apache
CentOS
CloudLinux
cPanel
Emails
ESXI
iSCSI
JetBackup
Litespeed
MySQL
NGINX
Oracle
Reduxio
Security
SSL
Uncategorized
VMware
Wordpress
XEN

Tags

apache aspx backup CentOS cloudlinux cPanel CXS Emails freetds google htaccess IMAP InnoDB iscsi JetBackup Libmodsecurity litespeed modsec modsecurity mssql MySQL netapp nginx odbc Oracle php php.ini phpselector rsync ssh VMFS WHM Wordpress xenserver

Popular Posts

  • Allow a cPanel server to run a VHOST from multiple IP addresses April 3, 2018
  • How To Install & Configure a Galera Cluster with MySQL on Centos 7 February 6, 2018
  • Libmodsecurity installation April 14, 2016
  • JetBackup Cheat Sheet :: Automatically Acknowledge Alerts November 15, 2018

Recent Posts

  • rsync without prompting for password October 10, 2022
  • Convert JetBackup to cPanel structure October 6, 2022
  • Configure LiteSpeed Crawler October 5, 2022
  • Change Hostname in Oracle Cloud Infrastructure (OCI) October 3, 2022

Recent Comments

  • Anonymous on InnoDB: Failed to find tablespace for table `X` in the cache
  • Khan on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Khan on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Oleg Drabkin on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Khan on Allow a cPanel server to run a VHOST from multiple IP addresses
Privacy Policy • Contact