How-to: build PHP 5.3/5.4/5.5 on Debian9/10/CentOS8

Finally, I manage to use LD_PRELOAD to load the specific .so library inside mod_fcgid wrapper scripts.

LD_PRELOAD=/usr/local/xxx/curl/lib/libcurl.so
export LD_PRELOAD

exec /usr/local/php53/bin/php-cgi53 ${OPTIONS}

It is working now.
I manage to run PHP 4.4 , 5.2 , 5.3 , 5.4 , 5.5 , 5.6 , 7.x inside CentOS 8,
whereas PHP 4 and PHP 5.x are using MariaDB 10.1 client library (installed in separate folder).
The host is running MariaDB 10.4 client and server library.
 
yes same here, do you have any solution for php 7x with openssl 3? Newly installed directadmin is unable to install any php versions lower than 8.1

php 5.x, 7.x and 8.0 cannot compile against openssl 3.0 or higher. Try php 8.1 or higher.

@smtalk @zEitEr
 
Did it, used --with-openssl and provided a dir where I have compiled openssl 1.1.1
still getting a bunch of errors with incompatibality.

/usr/local/directadmin/custombuild/php-7.4.30/ext/openssl/openssl.c:5895:25: warning: 'RSA_public_encrypt' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]

/usr/local/directadmin/custombuild/php-7.4.30/ext/openssl/openssl.c:5898:49: warning: 'EVP_PKEY_get0_RSA' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]


/usr/local/directadmin/custombuild/php-7.4.30/ext/openssl/openssl.c:5957:25: warning: 'RSA_public_decrypt' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]

/usr/local/directadmin/custombuild/php-7.4.30/ext/openssl/openssl.c:5960:41: warning: 'EVP_PKEY_get0_RSA' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 
but there error about openssl 3, so something configured wrong, custom path not used
 
You may compile a OpenSSL 1.0.x in separate folder, and compile PHP 5.x with custom configure.php5x
Or, you may try to compile PHP 5.x without OpenSSL support.

---

IMGO, it shall be OK even if PHP 5.x does not contain OpenSSL library.

To end-user side, PHP 5.x was EOL in 201x already, only best-effort limited support.
 
yes same here, do you have any solution for php 7x with openssl 3? Newly installed directadmin is unable to install any php versions lower than 8.1

php 5.x, 7.x and 8.0 cannot compile against openssl 3.0 or higher. Try php 8.1 or higher.

@smtalk @zEitEr
Code:
mkdir -p /usr/local/directadmin/custombuild/custom/fpm
touch /usr/local/directadmin/custombuild/custom/fpm/.custom_openssl
 
@smtalk Will DA build old PHP with old OpenSSL in new OSs automatically, or for future we must build this manually?
 
Code:
mkdir -p /usr/local/directadmin/custombuild/custom/fpm
touch /usr/local/directadmin/custombuild/custom/fpm/.custom_openssl
Hi @smtalk ,

did those, same error as before.


Code:
cd /usr/local/directadmin/custombuild
mkdir -p custom/php
cp -p configure/php/configure.php74 custom/php/configure.php74
mkdir -p custom/fpm/
touch custom/fpm/.custom_openssl
perl -pi -e 's|with-openssl|with-openssl=/usr/local/lib_http2|g' custom/php/configure.php74
wget https://ftp.openssl.org/source/openssl-1.1.1q.tar.gz
tar xzf openssl-1.1.1q.tar.gz
cd openssl-1.1.1q
./config --prefix=/usr/local/lib_http2 no-ssl2 no-ssl3 zlib-dynamic -fPIC
make depend
make install
cd /usr/local/directadmin/custombuild
./build php_expert 7.4 php-fpm
./build rewrite_confs
 

Attachments

  • Screenshot 2022-08-01 at 13.41.15.png
    Screenshot 2022-08-01 at 13.41.15.png
    945.9 KB · Views: 22
Edit: In order for this to work edit /usr/local/directadmin/custom/php/configure.php74 file if you wish to have php 7.4

#!/bin/sh export OPENSSL_CFLAGS="-I/usr/local/ssl-1.1.1q/include" export OPENSSL_LIBS="-L/usr/local/ssl-1.1.1q/lib -lssl -lcrypto -lz" ./configure --enable-embed \ --prefix=/usr/local/php74 \ --program-suffix=74 \ --enable-fpm \ --with-fpm-systemd \ --enable-litespeed \ --with-config-file-scan-dir=/usr/local/php74/lib/php.conf.d \ --with-curl \ --enable-gd \ --with-gettext \ --with-jpeg \ --with-freetype \ --with-kerberos \ --with-openssl \ --with-mhash \ --with-mysql-sock=/var/lib/mysql/mysql.sock \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-pear \ --with-sodium=/usr/local \ --with-webp \ --with-xsl \ --with-zlib \ --with-zip \ --with-iconv-dir=/usr \ --enable-bcmath \ --enable-calendar \ --enable-exif \ --enable-ftp \ --enable-sockets \ --enable-soap \ --enable-mbstring \ --enable-intl


And then build PHP again

/usr/local/directadmin/custombuild

./build clean && ./build php_expert 7.4 php-fpm
 
I successfully built 7.4.32 lsphp (Ubuntu 22.04) but I can't open my sites when choose 7.4 in php selector.

I got such error log:
No request delivery notification has been received from LSAPI application, possible dead lock.
ExtConn timed out while processing.

Is there smth that I need to configure in OLS?
 
There are too little information even to guess, and too much work is needed to replicate the issue. I don't have Ubuntu 22.x as well as any other on my end for testing. So I do not have any other suggestion but that you invite somebody to check in on your server.
 
Back
Top