PHP —— Eclipse for php 环境搭建




修改根目录

XAMPP集成了PHP开发环境所需要的Apache和Mysql等基础组件。但是系统自带的根目录为 /Applications/XAMPP/htdocs 。有时候我们希望把网站根目录换成我们自定义的目录文件夹。可通过以下方式来实现
  • 1 打开 应用程序->XAMPP->xamppfiles->etc->httpd.conf 文档
  • commond+f搜索htdocs,搜到如下结果
# DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" <Directory "/Applications/XAMPP/xamppfiles/htdocs">
  • 3 修改DocumentRoot和Directory中的路径为你想要的路径,两个的路径要一样
在Mac中有些文件夹是只对本机用户有读写权限,如果是服务器去访问这样的文件夹的话会显示forbid。解决方法如下:
  • commond + f搜索User/Group,搜到如下结果
# User/ Group : The name ( or #number) of the user/ group to run httpd as .# It is usually good practice to create a dedicated user and group for # running httpd, as with most system services.#User daemon Group daemon
修改 User 为你的用户名。以此来获取读写权限



自己设置步骤:
1- 设置好程序根目录;

2- 设置好eclipse Servers 和 Executables

3- 编写代码 http://localhost/myPHP/index.php 即可执行 run as php web page



sudo apachectl stop
sudo apachectl start
sudo apachectl restart
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值