403 - Forbidden: Access is denied.on server - php

I am runing an php mvc project on server on localhost it is working fine . but when i uploaded the same project on server it is giving the following error ,not getting any kind of clue
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

Give that folder permissions to 777

There may be two reasons of this
1)folder does not have permission, so need to provide permission on this like:-
sudo chmod -R 0777 folder-path
2)Check for htacess file reside in this folder with deny permission

Related

Why laravel project is throwing an error on the server like There is no existing directory at "/home/....... and its not buildable: Permission denied?

I just hosted my laravel application on the server but when I am hitting my domain I am getting the error like:
There is no existing directory at "/home/cybuzz/public_html/myproj/storage/logs" and its not buildable: Permission denied.
I have cleared the cache, given the 777 permission to the storage folder as well but the issue persists the same.
Give permission to write for this directory-
If you dont have much idea about permissions, The simplest solution is
Run this command-
sudo chmod -R 777 /home/cybuzz/public_html/myproj/storage/

Laravel 5.4 laravel.log permission issue

I have Laravel 5.4 installed on my Mac using Composer and MAMP Pro. The installation completed successfully, but when I try to load localhost/lsapp/public, an UnexpectedValueException error is returned. I have checked the file permissions for the storage and logs directories and both are set to 755 using the command line. It seems the log file cannot be written for some reason. Any suggestions?
Full permission denied message: The stream or file "/Applications/MAMP/htdocs/lsapp/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
in StreamHandler.php (line 107)
When you go into a production environment, I'd recommend the following:
755 permissions for the /log
644 permission for the files inside
For example if you're using apache:
The user owner of the directory (www-data) can read, write and execute.
The assigned group (www-data, where my user is) can read and execute, but not write.
Everyone else can read and execute, but not write.
I just faced the same issue with my installation. Here's what I did to solve it:
Make sure that www-data (or your web server's user) is either the owner or group's owner of the logs directory.
Then make sure that this user have read-write-execute on that folder. On linux I used 770 for that folder. Then laravel is now working fine.
Hope that's help!

You don't have permission to access /phpmyadmin/ on this server LAMP

i have the following problem in accessing to my /localhost/phpmyadmin
I hope you can help me
Forbidden
You don't have permission to access /phpmyadmin/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request
.
The folder do not have the required permissions to access it. Please go to the folder where your server is pointing to and give it Read and execute access.
chmod -R 755 /path/to/folder
and you can make the folder accessible through web .
Here you have two errors:
You need to check the permission of folder ../phpmyadmin
The 403 error is an Apache one, have a look here to fix it:
http://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/

Wordpress class-wp-image-editor.php permission denied

I just changed the directory of my WordPress instance. I copied all files via FTP into the new folder and also copied the database and edited the site URL and home entries.
Now the page don't show the images, but gives me this message:
Warning: imagejpeg() [function.imagejpeg]: Unable to open
'/www/htdocs/serverID/wp-content/uploads/bfi_thumb/modell3-2xr5ffo5juzmz3rgn84d8g.jpg'
for writing: Permission denied in
/www/htdocs/w00db707/wp-includes/class-wp-image-editor.php on line 405
Everything else is looking good. Do you know whats wrong?
Two possibilities:
The file/folder permissions for /wp-content/uploads/ need to be CHMOD to 0755 or 0777
If the permissions are already set to 0755 or 0777, the owning user/group needs to match your HTTPD user (varies based on server configuration; sometimes the user is www-data, sometimes apache, if a Plesk environment it is the username you setup the subscription with)

Laravel from localhost to server error

My laravel 4 project was created on localhost. Now i am trying to put it on the server (shared hosting) but i am running in to an error. First let me explain how i uploaded my laravel project.
mydomain.nl
mydomain.nl--public_html
mydomain.nl--public_html--dev
mydomain.nl--public_html--packages
mydomain.nl--public_html--index.php
mydomain.nl--public_html--.htacces
mydomain.nl--public_html--all other contents form public laravel folders
mydomain.nl--project
mydomain.nl--project--bootstrap
mydomain.nl--project--vendor
mydomain.nl--project--app
mydomain.nl--project--all other folders and files wich were not in laravel public folder
Then i changed my mydomain.nl/project/bootstrap/paths.php to:
'public' => __DIR__.'/../../public_html',
And my mydomain.nl/public_html/index.php to
require __DIR__.'/../project/bootstrap/autoload.php';
$app = require_once __DIR__.'/../project/bootstrap/start.php';
If i go to my domain i get the following error
Error in exception handler: The stream or file "/hostingvariables/project/app/storage/logs/laravel.log" could not be opened: fopen(/hostingvariables/project/app/storage/logs/laravel.log) [function.fopen]: failed to open stream: Permission denied in /hostingvariables/project/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:77
I tryd everyting i could imagine but i can not solve this error, if someone could help me solve this error that would be great?
The error tells you that you dont have write access to
/hostingvariables/project/app/storage/logs/laravel.log
it says
Permission denied
So if you can chmod it to 775, or contact your host if it a shared solution where they control write access
I like this method best. Instead of changing folder permissions, set Apache to run as you.
In terminal type id to get uid=123(Myname).
Open /etc/apache2/httpd.conf and edit it to use your username.
<IfModule unixd_module>
User Myname
Group staff
</IfModule>
Back to terminal: sudo apachectl restart

Categories