XAMPP localhost returns object not found after installing Laravel XAMPP localhost returns object not found after installing Laravel laravel laravel

XAMPP localhost returns object not found after installing Laravel


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

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

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

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

<VirtualHost *:80>ServerName localhostDocumentRoot "/Applications/XAMPP/htdocs"<Directory "/Applications/XAMPP/htdocs">Options Indexes FollowSymLinks Includes execCGIAllowOverride AllOrder Allow,DenyAllow From All</Directory></VirtualHost>


It sounds to me like it is a problem with the way your directories are configured. Be sure to create a Virtual Host (if you're using Apache) that points to the public folder within your application directory.

For example, if your Laravel project is under /Applications/XAMPP/htdocs/Laravel then set up a Virtual Host like this:

<VirtualHost *:80>    DocumentRoot /Applications/XAMPP/htdocs/Laravel/public    # Other directives here</VirtualHost>

Additionaly, if you're working with PHP >= 5.4, SSH into the application folder and run

./artisan serve

(Be sure that your PHP executable is in your PATH variable). Then go localhost:8000 and you should have your application running. Running this command runs the PHP built-in webserver and saves you the trouble of configuring virtual hosts.


In your Apache's http.conf, find the DocumentRoot line and add the subdirectory /public on the end.

Once that is done and you've restarted Apache, you'll be able to access everything which is contained within your htdocs/public folder (including subdirectories of that folder), along with any routes you've defined in Laravel.

Laravel is designed to be set up this way as to protect the code and files by not having them in the folder which is served out to the web.