安装Laravel后XAMPP本地主机返回未找到的对象 [英] XAMPP localhost returns object not found after installing Laravel

查看:100
本文介绍了安装Laravel后XAMPP本地主机返回未找到的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过多方支持,我让laravel与XAMPP一起工作.但是,我现在似乎无法通过localhost访问htdocs文件夹中的目录.尝试访问文件将返回Object not found!The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

After much faffing about I got laravel to work with XAMPP. However, I can't seem to access directories in the htdocs folder via localhost now. Attempt to access a file returns Object not found! along with The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

我为使laravel正常运行所做的更改现在看来像是模糊的.我记得做的唯一一件事是编辑hosts文件以通过在主机文件中添加127.0.0.1 laravel.dev(使用mac btw)来使虚拟主机正常工作.我还将虚拟主机添加到了httpd-vhost.conf文件中.

The changes I made to get laravel working seems like a blur now. The only thing I remember doing is editing the hosts file to enable the virtual host to work by adding 127.0.0.1 laravel.dev in the hosts file (using a mac btw). I also added a virtual host to the httpd-vhost.conf file.

我确实撤消了上述更改,但没有任何变化.

I did undo the above changes but it didn't make a difference.

对出什么问题有任何想法吗?

Any thoughts on whats gone wrong?

谢谢.

消除混乱 只是以为我会澄清自己的经历.在安装 laravel 4 之前,我可以使用localhost/someProjectName访问我的所有项目,但是现在失败了.

Dispelling Confusion Just thought I'd clarify what my experience is. Before installing laravel 4 I could access all my projects with localhost/someProjectName but now it fails.

我正在尝试确定导致此行为的更改.顺便说一句,我访问laravel项目没有问题(我的映射使我可以通过laravel.dev访问它)

I'm trying to identify what change caused this behaviour. Btw, I have no problems accessing my laravel project (my mapping allows me access to it via laravel.dev)

推荐答案

查看您的/etc/httpd.conf文件,查看是否已激活虚拟主机.

Look into your /etc/httpd.conf file and see if you have Virtual hosts activated.

如果是,请检查您的etc/extra/httpd-vhosts.conf文件.您可能已经设置了VirtualHost.

If so, check your etc/extra/httpd-vhosts.conf file. You might have set up a VirtualHost already.

我发现打开虚拟主机后,XAMPP需要基本htdocs文件的默认虚拟主机.

I have found that once you turn on Virtual Hosts, XAMPP needs a default VirtualHost for your basic htdocs files

尝试添加默认的VirtualHost(位于文件底部),如下所示:

Try adding a default VirtualHost (at the bottom of the file) like so:

<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/htdocs"
<Directory "/Applications/XAMPP/htdocs">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
</VirtualHost>

这篇关于安装Laravel后XAMPP本地主机返回未找到的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆