I have a Laravel project which works on my Windows. I'm trying to transfer it on my Mac. Unfortunately, I have an Error 500 when I go on my website. When I check apache log I have : client denied by server configuration. Apache is 2.2 version on MAMP.
This error means that the access to the directory on the file system was denied by an Apache configuration.
check runner of apache and permissions of directories ...
in installation of laravel :
Directory Permissions
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run. If you are using the Homestead virtual machine, these permissions should already be set.
Change the chmod of storage and all files inside by -R, and also don't forget to do the same with the bootstrap/cache folder.
chmod -R 775 storage
chmod -R 775 bootstrap/cache
Check that on "Directory Permissions" in the official laravel documentation installation : https://laravel.com/docs/5.3/installation
Hope that helped. Regards.
Related
I don't know how laravel handles it, but can anybody give me a quick overview of how does laravel check folder permissions (storage and bootstrap)?
I have tried using is_writable("storage") but it doesn't seem to work atleast on a laravel installation on WAMP server. It gives true every time I try to run it.
Any other suggestions?
The storage and bootstrap/cache should be writable by your web server or Laravel will not run according to documentation (Directory Permissions
section).
So it's obvious that is_writable("storage") will always return true on your running Laravel app.
Note: You can use following commands to configure directory permissions after installing Laravel:
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
I've read through the official docs of drupal 8 and still don't get the idea of how to setup correct permission of the folders and files.
When we give 777 permission it might work but it's not an elegant way to do so, is there any easy way to setup permission. I'm using Ubuntu 16.04.
If your system is running with an enforced security policy (SELinux) you may have to set the appropriate rules for httpd/drupal to run properly.
Other than that, following requirements as specified in INSTALL.TXT should be enough.
Missing files directory :
mkdir sites/default/files
chmod a+w sites/default/files
You can also set permissions on sites/default/ as well so that your web server is able to create directories under this path :
chmod a+w sites/default
Missing settings.php :
cp sites/default/default.settings.php sites/default/settings.php
Make it writable for the installation :
chmod a+w sites/default/settings.php
And once the installation is finished, set the permissions back :
chmod go-w sites/default/settings.php
Multisite :
For a multisite installation you would replace default by the site directory :
mkdir sites/example.com/files
chmod a+w sites/example.com/files
cp sites/default/defaults.settings.php sites/example.com/settings.php
I have a Laravel project (version 5.3) that works well on my localhost (wampserver).
Now I want to run this project on a subdomain of my website.I have ssh root access and a vps user access (not admin - with Directadmin - PHP version 5.4).
I uploaded project files to my server but when I try to see the project result , it gives me a 500 error.
I have tried to change 'storage' folder permissions , so I read this answer , but when I run "chchon" ssh command , I get errors like this :
can't apply partial context to unlabeled file ...
also , I have tested Laravel with version 4.2 and it worked well.
Does any boy have idea ?? Thanks
If you don't have SELinux enabled, you can set permissions simply with chmod or set the owner of the storage directory with chown to the web server's user. (which is probably www-data)
Try to run sudo chown -R www-data storage in the project directory
Try all this
// first delete the vendor folder inside your project root, then run
composer install
// laravel generates log file there
sudo chmod -R 777 storage/logs
// laravel cache the files here
sudo chmod -R 777 bootstrap/cache
// vendor folder, where laravel saves their dependencies
sudo chmod -R 777 storage/ vendor/
// generate a application key
php artisan key:generate
This might help :)
We have a Laravel app (version 4) that we're trying to deploy on AWS. Previously, it was hosted in our local servers via XAMPP. On AWS, I created a folder for the laravel app in var/www/html directory path. But as I try to access http://aws-url/laravel_folder/public, I get the error message:
Error in exception handler: The stream or file "/var/www/html/laravel_folder/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /var/www/html/laravel_folder/bootstrap/compiled.php:9134
I've checkout all similar questions and have followed the suggestions, i.e. setting permission of laravel.log to 777, but still keep getting the same problem.
How do I fix this problem?
Thank you
First 777 permission is not a good idea.
If you're on linux, use the following command:
chmod -R 770 logs (add sudo in front if you're not the owner of the folder!)
That will give owner and group read-write-execute permission on the logs folder and everything inside it but will give no permission to other users.
Also make sure that the folder and files inside it have the web server's user as group.
Hope that's help!
You need to set the permissions for the entire storage folder to 777
sudo chmod -R 777 storage/
Just learning CakePHP and its Bake feature.
I tried to run
../cake/console/cake bake
from the app folder, but I get the error
../cake/console/cake: Permission denied
chmod 777 nor chmod +x don't work. I still get permission denied.
Also tried setting permissions thru the Properties window, but when I check "Allow executing file as program", it changes right back to unchecked.
If it makes any difference, my www/ folder is on an NTFS mounted partition. I used xampp on Windows before, and when I switched to Linux, www/ is still in that NTFS partition, and I just had my Apache in Linux point to that folder.
Any suggestions?
the default linux ntfs driver cannot properly handle permissions settings on NTFS devices.
you need to look into the NTFS-3G drivers.
this might help
https://unix.stackexchange.com/questions/11757/ntfs-under-linux
In case it helps anyone, what I ended up doing is that I changed Apache's www folder location to ~/www and did my baking there. When I was done, I restored Apache's www folder to my NTFS partition, then copied into it my newly-baked application.