I'm trying to create a new Laravel project via "laravel new project_name". Everything works well until I try to view it in a browser.
$ larvel new laravel
bash: larvel: command not found...
$ composer global require "laravel/installer=~1.1"
Changed current directory to /home/username/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
$ laravel new laravel
Crafting application...
Generating optimized class loader
Application key [5KwxlNJO2fdnBtuzuUmZuYWrFTXntYqU] set successfully.
Application ready! Build something amazing.
When I go to http://localhost/project_name/public The browser returns the following:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in/var/www/html/laravel/public/index.php on line 50
I updated PHP to version 5.6.9 and repeated the process based on another thread in this forum. But that didn't change anything.
Any help or guidance would be greatly appreciated.
You should be setting the root directory of the web server to "project_name/public" so when you visit http://localhost it sends it to the index file in the public folder via htaccess. I don't know if that fixes it, but based on the limited info it appears it would.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community