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 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)