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

    5th October 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.

    30th September 2022
  • LiteSpeed lsphp 7.4 zip Support

    LiteSpeed lsphp 7.4 zip Support

    30th September 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
Linux
Litespeed
MySQL
NGINX
Oracle
Reduxio
Security
SSL
Uncategorized
VMware
Wordpress
XEN

Tags

apache aspx backup bash 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 ssmtp systemd threads VMFS WHM Wordpress xenserver

Popular Posts

  • Convert JetBackup to cPanel structure 6th October 2022
  • How To Install & Configure a Galera Cluster with MariaDB on Centos 7 6th February 2018
  • Allow a cPanel server to run a VHOST from multiple IP addresses 3rd April 2018
  • rsync without prompting for password 10th October 2022

Recent Posts

  • Understanding Why More Threads Can Sometimes Slow Down Performance 9th October 2024
  • Set up a new systemd service 18th May 2024
  • Bash Arrays 7th November 2023
  • rsync without prompting for password 10th October 2022

Recent Comments

  • Sven on rsync without prompting for password
  • TheLazyAdmin on rsync without prompting for password
  • Sven on rsync without prompting for password
  • TheLazyAdmin on Convert JetBackup to cPanel structure
  • Chris on Convert JetBackup to cPanel structure
Privacy Policy • Contact