Reputation: 379
I faced a "mkdir(): permission denied" problem when creating a new laravel project via composer by
composer create-project laravel/laravel lsapp
command, so I was looking at this solution.
It said to change the group ownership by sudo chown -Rv root:$USER .
but he was doing this to cd var/www/
, so this make me wondering if he did this because he put his files into /var/www/
so I should execute the command on /opt/lampp/htdocs/
.
or I should execute the command on /var/www/
regardless which directory I use to put my files.
And finally what is the usual directory people used to put their laravel project into ?
update:
I try to change the ownership to both directories so now I know that the command executed to your directory, now the question still what is the best place to put my laravel project, and if I choose /var/www/
how can I open it from the browser with /localhost
Upvotes: 0
Views: 1105
Reputation: 1036
You need to point your apache .conf file to where ever your files are stored. Here is an example:
<VirtualHost *:8000>
DocumentRoot "/var/www/myproject/public/"
ServerName localhost
<Directory "/var/www/myproject/">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
This project will be at "localhost:8000"
If your project is not stored in "var/www", then just change those parameters in this block of your conf file in your apache configuration. This can be found in /etc/apache2/sites-enabled/myproject.conf
(on linux)
Upvotes: 1