Apache with PHP 5.3 in 2021 - php

I'm trying to install PHP 5.3 and an Apache webserver on Ubuntu 20.04. I know that PHP 5.3 is very old, but i need it temporary while i'm upgrading the Website to a new PHP Version.
I have tried multiple ways.
Installed Apache via repo and PHP with binaries multiple times. (with different switches like --with-apxs2, --enable-so)
I also tried to install Apache from binaries as well.
But every time the PHP code was sent as comment to the client. The PHP module was activated.
I don't find anything on the web anymore. Is it even possible to install on a new system like ubuntu 20.04
Do you know where I can find a step by step Instruction for installing PHP 5.3 in 2021 ^^
Or am I missing out something obvious.
Thank you for your help

Thanks to Slava Rozhnev. I tried the installation with Ubuntu 14.04 and followed this guide : https://gist.github.com/arbabnazar/edf23236f33e1f5c052b6444ef6cebe0
And it worked ^^

Related

How to enable curl in php 7.3+ in uwamp server

I'm running Uwamp server under windows7 and it works perfectly with php versions from 5.5 to 7.0.3 and with curl enabled.
When I switch to php 7.2, 7.3 or latest 7.4.3 uwamp server still working - but without curl.
php_curl.dll file is enabled under extensions (ext) but phpinfo() confirms that curl extension is missing / not enabled. I compared php.ini with previous php versions, modified it but it still doesn't work.
cURL is NOT installed on this server
I have testet xampp and this server has no problem with curl and php 7.3/7.4. I compared php.ini etc. but curl extension still not working under Uwamp.
It seems that the author of the project has abandoned it, because there have been no updates or activities since many years. Maybe someone using it and can help me to solve it.
Any idea would be greatly appreciated!
finally got a working solution for this problem of uwamp and running an up to date version of php and getting curl working.
I have sat here for a couple of days trying to work why you couldn't get a later version of php 7.0.3 without breaking uwamp and curl. So I learnt how to integrate and test php apache as standalones and then working on updating uwamp. Lots of head scratching of working out how uwamp uses its on the fly configuration setup.
I will list all the steps to update your version of uwamp (to apache 4.2 and php 7.4.4 as of Mar 2020)
Download uwamp (portable or installer)
Download c++ runtime https://aka.ms/vs/16/release/VC_redist.x86.exe (taken from the windows php page)
Install the runtime above
Install uwamp to a directory (in this example will just use c:\ making it install to c:\uwamp after expanding)
Before running uwamp
Goto to apache lounge website and download the latest 32 build of apache (4.2)
https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.41-win32-VS16.zip
Expand this archive, it should create a folder called apache2.4
Step in to this directory and copy all the files and paste them here in your uwamp folder (c:\uwamp\bin\apache). This should overwrite all the apache files and add the latest apachephp dll
TIP. Just make sure you havent expanded the apache2.4 zip in the uwamp apache folder, easy to tell as you will see a apache24 appear
Goto to php.net and download the latest THREAD SAFE version of php (7.4.4)
https://windows.php.net/downloads/releases/php-7.4.4-Win32-vc15-x86.zip
Extract the php zip this folder in to the c:\uwamp\bin\php in to a new folder with name of php-7.4.4 (so the files should be in c:\uwamp\bin\php\php-7.4.4)
There you are, you have completed your manual upgrade of uwamp , run uwamp and if no errors appear with in the GUI, everything should be working. Test by opening a browser and use http://localhost/uwamp/phpinfo or http://127.0.0.1/uwamp/phpinfo or click the "phpinfo button" in the uwamp GUI
This way seems to allowed an upgrade of uwamp (except sql) but resolve a common problem of php and curl not working / breaking.
This works for x86 version installed on a 32/64 bit system.
Still trying to work out the kinks for uwamp to be running 64 bit apache and php but should be possible.
Try and delete the version of PHP that is affected by the missing Curl extension and then re-download the version from inside the AWamp interface. I have had similar problems with other extensions and have solved it this way.

Install specific PHP version on Ubuntu 16.04 server

I need a bit of help. I have AWS EC2 server running on Ubuntu 16.04. My question is how do I install specific PHP version 7.3.12 ?
I have installed PHP and it ended in 7.3.14. Is this gonna be an issue if I have local environment with PHP 7.3.12 ? And how do we specifically install 7.3.12 on ubuntu server?
Many thanks for your help.
You will not have any issue between PHP 7.3.12 and 7.3.14.
A version is split in 3 parts, 7(for main version).3(for current minor version).12(for bugfixes).
Do not try to exec php code on two differents main version 5.0 / 7.0 because of many big changes.
Also there is no many changes in minor version but still, you can have some differents behavior.
And the last one for bugfixes, you should not worry about.
For a complete list of change you can find the changelog : https://www.php.net/ChangeLog-7.php#PHP_7_3
Bugfixes version are release all life of supported version, for exemple PHP 7.3 will have security fixes until 6 Dec 2021.
For actual list, see : https://www.php.net/supported-versions.php
For your other question, you can install another version of php with major an minor (like php 7.2 or php 7.3) in ubuntu and change the path of the php exec command.
But you can't choose (Not sure at 100%) between php 7.3.12 and 7.3.14 because it's bugfixes and it's just a update.

It is possible to use different PHP versions in lampp [duplicate]

I'm developing one web application, using PHP eclipse IDE.
For an instance i want to switch from one PHP version to another version which resides in different location.
Below is my working environment :
1) Having Centos OS
2) PHP 5.1.6 have installed already while installing centos OS
3) Above PHP is installed in /usr/bin/ path
4) I have installed LAMPP in /opt/lampp
5) In LAMPP present PHP 5.2.6 version
I want to configure local web server such that lampp should choose PHP 5.1.6 (which resides in /opt/lampp )
I am not aware of this switching of PHP version.
Please suggest me how should i configure this switching of PHP version in my local web server.
Which configuration file should i choose for modifying this change.
Thanks a lot !!!
-Pravin
http://gggeek.altervista.org/2007/07/21/running-multiple-php-versions-on-a-single-apache-install/
This guide is a great guide and will get you started!
Another alternative would be to install Xampp, as I believe they provide a batch file that helps you switch versions of PHP in a second.

ubuntu php 5.5.38 upgrade to 5.5.9

This is my first question since registering here at Stack Overflow.
I have installed Linux Mint 18 (Sarah) which runs of the 16.04 base of Ubuntu as I understand it (I am still fairly new to Linux ~1 year experience).
My issue is that I am trying to run the same version of PHP locally as in the production environment. I managed to install php 5.5.38 but the prod environment is running 5.5.9 and I can't find how to do the upgrade.
I have tried updating my repositories and the executing the upgrade command. Nothing. I search online, and nothing.
I am thinking what I have to do is purge/uninstall php completely and add the correct repo? Is this right or can I upgrade somehow without uninstalling my current version completely?
Any insight into this is appreciated as well as recommendations as to what repo I should register from where I can get 5.5.9.
BR,
Henry
If this is still relevant, PHP 5.5.38 is newer than 5.5.9.
this is a minor version update look into the PHP release notes for that version.

Unable to install phalcon 2.x on VPS from 1and1 hosting

I ran into a troublesome issue.
I'm using 1 and 1 virtual private server redhat linux. The server's default PHP version is PHP 5.3.
I do have installed PHP 5.5 on the server. I switch to PHP 5.5 using alias php='path to php'.
I run command php -v to see if the version has changed, indeed it has - the PHP version is now 5.5.
However I am still unable to install phalcon, when I run the command ./install -i I get this error message:
Php 5.3 is not supported.
Any ideas how to resolve this problem?
Alias will not work in your case because it changes php path only for your terminal, not globally.
I'm not a redhat user so can't give you exact steps but a kinda dirty solution is to find your php binary (on debian is in /usr/bin/, /bin/ or /usr/local/bin), rename it to for example php5.3 and in this place make a symbolic link to new php.
Remember that your php webserver (apache, nginx or whatever you use) should also have an updated php! What is more, to compile phalcon you'll need also an updated phpize and other dependencies. I'm not a linux expert so cannot tell you exactly which parts of php5-dev did changed between PHP 5.3 and 5.5 and which did not.
Alternatively you can just clone from github and install an old phalcon 2.x which is also great. The new 3.0 doesn't have that much breaking features. It's killing feature is PHP7 which it seems that you're not going to use. Phalcon 2.x requires PHP5.4+
I belive there are better ways how a php update should be performed but I don't know them.

Categories