简体   繁体   English

如何使用apache和mysql安装php musesum版本

[英]How to install php musesum version with apache and mysql

I'm having trouble with installing old php 5.3.29 on ubuntu 16.04 我在Ubuntu 16.04上安装旧php 5.3.29时遇到问题

Recently I found this useful source on how to install old unsupported php versions which are available only in php museum 最近我发现这个关于如何安装不支持老版本的PHP仅在PHP博物馆提供有用的信息来源

sudo apt-get install apache2
sudo apt-get install make

# php museum version installation
sudo apt-get update
sudo apt-get install gcc libmysqlclient-dev libxml2-dev
wget --trust-server-names http://museum.php.net/php5/php-5.3.29.tar.bz2
tar xjf php-5.3.29.tar.bz2
cd php-5.3.29
./configure --prefix=$PWD/installdir --enable-bcmath --with-mysql 
sudo make install

Now I need to connect apache2 and php 5.3.29 but how ?? 现在我需要连接apache2和php 5.3.29,但是如何? (how to configure Apache to use php from custom directory) (如何将Apache配置为从自定义目录使用php)

All the articles I found talk about how to switch php version use update-alternatives --config php . 我发现的所有文章都谈到如何切换php版本,使用update-alternatives --config php That command ignores my php5.3 installed in the custom folder by make command. 该命令将忽略我通过make命令安装在自定义文件夹中的php5.3。

I even tried to symlink php executable file to /usr/bin 我什至尝试将php可执行文件符号链接到/ usr / bin

ln -s /home/ubuntu/php-5.3.29/installdir/bin/php /usr/bin/php5.3.29 ln -s /home/ubuntu/php-5.3.29/installdir/bin/php /usr/bin/php5.3.29

and again no luck with update-alternatives command run 再次使用update-alternatives命令没有运气

Hmm found another way (adding ppa repo) solution for this issue here: 嗯,在这里找到了另一种解决此问题的方法(添加ppa repo):

https://everton.rocks/conteudo/multiple-php-versions-apache https://everton.rocks/conteudo/multiple-php-versions-apache

# add this 2 lines to /etc/apt/sources.list
deb http://ppa.launchpad.net/sergey-dryabzhinsky/php53/ubuntu xenial main
deb-src http://ppa.launchpad.net/sergey-dryabzhinsky/php53/ubuntu xenial main 

sudo apt update
sudo apt install php53-apache2
sudo a2dismod php7.0
sudo a2enmod php53
sudo service apache2 restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM