dongpa9277 2013-06-10 13:32
浏览 45

Apache和PHP分离vhosts

Hello i want to ask how to setup apache in way that I will get on each vhost documentroot = "/" and separate php.ini.

i have this kind of folder structure:

root/
 domain1/
   php.files ect
 domain2/
   php.files ect

i want to get in each php file in domain1 & domain2 $_SERVER['DOCUMENTROOT'] = "/" and have ability to set individual php.ini which will override main php.ini directives.

I tried many things to set this documentroot but still have no idea how to make it work. I tried also with suPhp in order to handle php.ini but it seems to not meet my needs, or I dont know how to configure it.

  • 写回答

1条回答 默认 最新

  • dopzc64662 2013-06-10 13:43
    关注

    you need to edit 2 files 1- file is vhosts :

    Domain : example domain files : C:\xampp\htdocs\example

    <VirtualHost example>
        ServerAdmin ssc@ssc.com
        DocumentRoot C:\xampp\htdocs\example
        ServerName example
        ErrorLog logs/ssc-host.example.com-error_log
        CustomLog logs/ssc-host.example.com-access_log common
    
    </VirtualHost>
    

    2- Also if you using windows you need to edit hosts file :

    C:\Windows\System32\drivers\etc\hosts

    Add this line

    127.0.0.1 example

    3- Restart your Apache server

    4- write example in your browser

    and now you have your domain .

    评论

报告相同问题?

悬赏问题

  • ¥15 github符合条件20分钟秒到账,github空投 提供github账号可兑换💰感兴趣的可以找我交流一下
  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?