1

I`ve installed php 5.3.24 in my UBUNTU 18.0.4 but unable to show info.php page

Last login: Thu Jul 11 06:59:31 2019 from 10.10.2.194
sagar@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic
sagar@ubuntu:~$ 
sagar@ubuntu:~$ php -v
PHP 5.3.24 (cli) (built: Jul 11 2019 07:30:40) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
sagar@ubuntu:~$ 
sagar@ubuntu:~$ 

enter image description here

PLS Give any suggestion

Is UBUNTU 18 is compatible with php 5.3.24?

terdon
  • 100,812
sgor
  • 21
  • How did you install PHP 5.3? Why do you want 5.3, and not some more recent version that is actually in 18.04's repositories? – vidarlo Jul 11 '19 at 10:14
  • @vidarlo I`ve downloaded as guided in below URL (https://askubuntu.com/questions/1052746/can-i-install-php-5-3-5-on-ubuntu-server-18-04-lts) – sgor Jul 12 '19 at 03:26
  • 1
    Dear Angry Reviewers, Please note that Ask Ubuntu's "off topic" policy relates to the version of Ubuntu. This is addressed in Meta: https://meta.askubuntu.com/questions/18710/do-we-stop-supporting-external-software – Oli Jul 12 '19 at 15:37

2 Answers2

5

Do not run this on a public facing webserver.

This version of PHP has some rather ugly security problems.

Update your scripts to work with a newer php version. Anything else is plain stupid, and should only be used to verify functionality during porting of scripts.

First we'll have to install Apache development files, a few misc build dependants and build essentials:

sudo apt install apache2 apache2-dev build-essentials libxml2-dev libmariadbclient-dev-compat checkinstall

Now we can continue with the tutorial; Copy paste mostly, with some modifications:

cd /tmp && wget http://in1.php.net/distributions/php-5.3.29.tar.bz2
tar -xvf php-5.3.29.tar.bz2
cd php-5.3.29
./configure --with-mysql --with-apxs2=/usr/bin/apxs --with-tsrm-pthreads --enable-maintainer-zts --with-libdir=/usr/lib/x86_64-linux-gnu/ #Note extra options cf. other answer
make -j
sudo checkinstall
sudo a2enmod php5

Finally, you'll have to add the line

AddType application/x-httpd-php .php

to /etc/apache2/apache2.conf using your favorite editor. Add it near the bottom.

After that, do a

sudo service apache2 restart

And php 5.3.29 should be installed.

The above was tested on 18.04. You probably want other php modules as well, which has to be enabled with ./configure. Which depends on the code you plan to run.

vidarlo
  • 22,691
0
sudo apt install  build-essential
sudo apt-get install libxml2 libxml2-dev libssl-dev 
sudo apt-get install libcurl4-openssl-dev pkg-config
sudo apt-get install libcurl4-gnutls-dev libjpeg-dev libpng12-dev libmysqlclient-dev
sudo apt install apache2 apache2-dev  libxml2-dev   checkinstall

cd /tmp && wget http://in1.php.net/distributions/php-5.3.29.tar.bz2
tar -xvf php-5.3.29.tar.bz2
cd php-5.3.29

 ./configure --with-mysql  --with-libdir=/usr/lib  --with-apxs2=/usr/bin/apxs  --with-tsrm-pthreads --with-libdir=/usr/lib/x86_64-linux-gnu/

make clean 
make 
sudo checkinstall

nano /etc/apache2/apache2.conf

Finally, you'll have to add the following line to /etc/apache2/apache2.conf

AddType application/x-httpd-php .php

sudo a2dismod mpm_event sudo a2enmod mpm_prefork

sudo a2enmod php5

tinlyx
  • 3,230