dongying2112 2019-01-25 08:38
浏览 68

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

I'm having trouble with installing old php 5.3.29 on ubuntu 16.04

Recently I found this useful source on how to install old unsupported php versions which are available only in php museum

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 ?? (how to configure Apache to use php from custom directory)

All the articles I found talk about how to switch php version use update-alternatives --config php. That command ignores my php5.3 installed in the custom folder by make command.

I even tried to symlink php executable file to /usr/bin

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

  • 写回答

1条回答 默认 最新

  • duanhegn231318 2019-01-25 10:47
    关注

    Hmm found another way (adding ppa repo) solution for this issue here:

    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
    
    评论

报告相同问题?

悬赏问题

  • ¥15 socket通信实现多人聊天室疑惑
  • ¥15 DEV-C++编译缺失
  • ¥33 找熟练码农写段Pyhthon程序
  • ¥100 怎么让数据库字段自动更新
  • ¥15 antv g6 力导向图布局
  • ¥15 quartz框架,No record found for selection of Trigger with key
  • ¥15 锅炉建模+优化算法,遗传算法优化锅炉燃烧模型,ls-svm会搞,后面的智能算法不会
  • ¥20 MATLAB多目标优化问题求解
  • ¥15 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数