Skip to content
Advertisement

php not working on ubuntu desktop 16.04.02

I need php < then 5.3 becouse software I inherited use mssql library.

SO I have set up linux, and apache (working fine via localhost or ip) then:

I get libxml in version below 2.9 (otherwise make php will not work – compiler will lack some older libraries I belive)

sudo wget ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz #get package
sudo tar -xvf libxml2-2.8.0.tar.gz  #unpack
cd libxml2-2.8.0 #:) rest is quite obvious
sudo ./configure 
sudo make
sudo make install

So I have libxml instaled and go with php same way

sudo wget http://museum.php.net/php5/php-5.2.17.tar.gz
sudo tar -xvf php-5.2.17.tar.bz2
cd php-5.2.17
sudo ./configure
sudo make
sudo make install

All seems to be ok, except php is not working. Apache doesn’t include it so php page output looks exacly same a code like:

both in code and webpage: aaaaaaaaaaaaaaaaaaaaa
<?php
echo "BBBBBBBBB";
?>

What I found so far:

check mods-enabled - I have no php mod at all there

uncomment #LoadModule php5_module libexec/apache2/libphp5.so - I don't have this line at all i apacheconf

run a2enmod php5.2.17 - return "module php5.2.17 doesn't exist"

Advertisement

Answer

I finally resolved my problem by instaling ubuntu 14.04 (maybe later I will update it to 16, and maybe old php will still be working), ale then by instaling LAMP in 1.2.4

This version can be found here: https://community.bitnami.com/t/where-to-find-lamp-stack-running-php-5-2-for-old-software/31209/12

Ubuntu must be 32 bit!!!

How to instal .run file?

sudo chmod +x lamp.1.2-4 
sudo ./some-app.run

what is worth to change too in php.ini:

error_reporting = E_ALL & ~E_NOTICE 
display_errors = On 
short_open_tag=On

htdocs is in: /opt/lampstack1.2-4/apache2/htdocs Php ini is easily find via phpinfo() function

basic operations (in opt/your lamp directory:)

sudo ./ctlscript.sh restart apache
sudo ./ctlscript.sh status

Alternative is here https://askubuntu.com/questions/597462/how-to-install-php-5-2-x-on-ubuntu-14-04 – I managed to do it all (mentioned links to patchs are broken), but in the end php5 module that I had to install newest 5.x php so I ended with 5.6.xxx against my will 🙂

I could not make mssql to work so far, but I will ask new question for this.

Hope this helps somebody.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement