Answer the question
In order to leave comments, you need to log in
Where to find and how to install PHP 5.4 on Ubuntu 16.04?
Hello guys, I really need help. The site was transferred from the centOS server (php 5.4) to the Ubuntu locale. The oldest version available in turnips - php5.6 - I installed it, but the site does not want to start normally. Basically, the reason for the failures in data processing is the same - "the method of shud notes bi sold statics" - well, you understand. The site is large (5 gigs, not counting the cache), on Bitrix. scripts download components from different parts of the web server. Such errors are very common and constantly climbing into the source code and putting @ in front of an unexecuted method is already tired.
In php 5.4 there are no such errors and everything plows the rules, but I can’t put it in any way. Already searched the whole Google.
The oldest turnip I found https://launchpad.net/~ondrej/+archive/ubuntu/php5..., but even after adding it and updating it, the apt writes to me "No candidate for installation was found for the package "php5""
The package was assembled and installed from php.net, it was installed in usr/local/lib/php, although the versions that I put through apt, fell in etc / php.
php -v gives me 5.4.45 , and phpinfo() - 5.6 Tell me
how to change the php version in Apache (2.4)? Tried restarting it - no change.
Thank you all in advance.
Answer the question
In order to leave comments, you need to log in
Of course, you can get confused and build PHP from source. In addition, you will have to build Apache from source with the addition of the PHP module (libapache2-mod-php).
Unfortunately or fortunately, most developers have lost the ability to build something from the source code for free. Unless extensions for the same PHP (pecl) sometimes have to be collected.
As an option, I suggest using such a wonderful thing as containerization, namely Docker. At the current time, this is the most elegant and correct solution. Added linking with MySQL DBMS to the example below
docker network create mysql_net
docker run --name app --net mysql_net -d -p 8080:80 \
-v /host/to/path/app:/var/www/app/ \
-v /host/to/path/config_apache:/etc/apache2/sites-enabled/ \
romeoz/docker-apache-php:5.4
docker run --name db --net mysql_net -d \
-v /host/to/path/data:/var/lib/mysql \
romeoz/docker-mysql:5.5
/host/to/path/data
is the directory with your data (DB). db
, because the DBMS container has the following name - --name db
. http://localhost:8080
. For beauty, you can set in /etc/hosts
your domain, for example, 127.0.0.1:8080 myapp
. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question