解决办法:
http://remindme.blogbus.com/logs/34713363.html
这位仁兄帮我解决了这个问题,通过建立虚拟目录的方式指向我的文件夹,而且通过其第二种方法可以省去我们在建立zendstuido后测试网页对网址的修改(比较乱,如果你也和我一样是初学的话你就会明白为什么我在这上面花了这么多时间来搭建测试环境)。为了防止网页失效,我把这位仁兄的原文也拷贝过来:)
Linux下建立php开发环境,就像朋友推荐的一样,还是xampp比较快速方便,当然,我是解压在/opt/lampp下的,因为一般情况下都不是以root用户进入系统,所以如果以/opt/lampp/htdocs为根目录,在权限方面是比较麻烦的,除非用root 运行easyeclipse,当然是不建议的,所以,我们就需要把我们的开发目录移动到一般用户下,我的是/home/yunqing/workspace/php,方法有两个,如下:
方法一:连接
sudosu
ln -s/home/yunqing/workspace/php /opt/lampp/htdocs
就可以在/opt/lampp/htdocs下看到一个连接php,在浏览的时候只要点击php就可以浏览/home/yunqing/workspace/php下的内容了,不过这样的缺点是,不方便文件的管理,比如要改变文件的读取写入执行权限时,必须到/home/yunqing/workspace/php下改变文件夹或者是文件的权限,非常不方便,相对而言,第二种方法就可以解决这个问题.
方法二:建立虚拟目录
sudosu
cd/opt/lampp/htdocs
mkdirlink (link为虚拟目录名)
cd/opt/etc
vimhttpd.conf
添加如下代码
#虚拟目录路径
Alias/link "/home/yunqing/workspace/php"
#虚拟目录设置
<Directory"/home/yunqing/workspace/php">
#
# Possible values for the Options directiveare "None", "All",
# or anycombination of:
# Indexes IncludesFollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must benamed *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
#http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
# XAMPP
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccessfiles.
# It can be "All", "None",or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
#AllowOverride None
# since XAMPP 1.4:
# AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allowfrom all
</Directory>
可以这样理解,将/home/yunqing/workspace/php文件夹下的内容全部挂到/opt/lampp/htdocs/link目录下,这样就可以通过<Directory> </Directory>非常方便得修改虚拟目录的权限问题.
在这里需要注意的是
1、上面的”mkdirlink”与配置文件中的#虚拟目录路径Alias/link "/home/yunqing/workspace/php" 中的link要对应上否则会出错。
2、建设在建立这个连接时用准备给PHP项目起的名字命名,这样在调试时会方便很多。
例如我给项目起了个名称为phpdemo,那我在建立link时也用这个名称,这样你就可以在浏览器中直接查看http://localhost/phpdemo/你的php文件,这样的好处你用了zend查看页面时就知道了