duanchu7271 2012-07-03 14:47
浏览 27

使用虚拟机设置具有可切换PHP版本的本地Web服务器

I've used XAMPP for local web development for a number of years, but I'm becoming increasingly frustrated with its limitations and would like to switch to a different solution.

What I'm looking for is something that will easily allow me to switch between different versions of PHP. The plan I've got in mind at the moment is to set up a local version of Ubuntu via Parallels (I seem to remember that I'll only need the Desktop edition of Ubuntu and not the Server addition to do what I want to do) and then to use this to provide a web server to the Mac OS X host that will be available at http://localhost/.

I suppose the ideal solution would enable me to have multiple web servers running from the same Ubuntu virtual machine, so that http://localhost-529/ was a web server running php 5.2.9, http://localhost-531/ was a web server running PHP 5.3.1, etc.

Is this possible? And is the idea I've outline the way to proceed, or is there a better way to get this setup working?

  • 写回答

1条回答 默认 最新

  • douguiyan9164 2012-07-03 14:59
    关注

    you should take a look at VirtualHost

    eg it could be possible to do the following:

    <VirtualHost *:80>
       ServerName www.localhost-529
       ServerAlias localhost-529
       LoadModule php5_module        modules/libphp5.so
       ...
    </VirtualHost>
    <VirtualHost *:80>
       ServerName www.localhost-4
       ServerAlias localhost-4
       LoadModule php4_module        modules/libphp4.so
       ...
    </VirtualHost>
    

    the names localhsot-529, localhost-4 have to entered in the hosts file of your clients

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器