dqhr76378 2016-07-25 03:53
浏览 44

Mac上的Apache,MySql,dan PHP

I am following this tutorial to setup my Mac as the web server: https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/

But unfortunately I got stuck, if I access the http://localhost/~username/info.php it works normally, but when I access only: http://localhost/info.php it says forbidden, any idea how to fix this?

Edit:

I want to access both the System root and User root
Big Thanks

  • 写回答

1条回答 默认 最新

  • duanlanzhi5509 2016-07-25 04:22
    关注

    I think to achieve this, you would need to activate and use virtual host.
    Try this:
    1) Open httpd.conf file:

    sudo nano /etc/apache2/httpd.conf
    

    2) Look for followig line and uncomment it:

    # Virtual hosts
    
    Include /private/etc/apache2/extra/httpd-vhosts.conf
    

    3) This will allow usage of the httpd-vhosts.conf file, open this file to add in the vhost.

    sudo nano /etc/apache2/extra/httpd-vhosts.conf
    

    4) Add following code in the start of the file.

    <VirtualHost *:80>
    ServerName localhost
    DocumentRoot /Library/WebServer/Documents/
    </VirtualHost>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。
  • ¥15 stm32的can接口不能收发数据
  • ¥15 目标检测算法移植到arm开发板
  • ¥15 利用JD51设计温度报警系统
  • ¥15 快手联盟怎么快速的跑出建立模型